1. ## algebra squares problem

(i) If $n$ is a positive integer, such that $2n+1$ is a perfect square, show that $n+1$ is the sum of two successive perfect squares.

(ii) If $3n+1$ is a perfect square, show that $n+1$ is the sum of three perfect square.

2. (i)A square of an odd number
$(2k+1)^2=4k^2+4k+1$
If $n = 2k^2+2k$ then $(2k+1)^2=2n+1$ and that shows that $2n+1$ is the square of an odd number.
Now consider $n+1 = 2k^2 + 2k + 1 = k^2 + (k^2 + 2k + 1) = k^2 + (k+1)^2$ that is the sum of two successive squares.
(ii) A number can be of the form $3q+r, r\in \{0,1,2\}$
Square can thus be of the form :
$(3q)^2 = 9 q^2$
$(3q+1)^2 = 9 q^2 +6q +1 = 3(3q^2+2q)+1$
$(3q+2)^2 = 9 q^2 +12q +4 = 3(3q^2+4q+1)+1$
So if $3n +1$ a square then $n =3q^2+2q \text{ or } n=3q^2+4q+1$
Then n +1 is form (when 3n+1 is odd) $3q^2 + 4q + 2 = q^2 + 2q+1 +q^2 +2q+1 + q^2 = 2\cdot (q+1)^2 + q^2$ or is form (when 3n+1 is even) $3q^2 + 2q + 1 = q^2 + 2q+1 +q^2+ q^2=(q+1)^2 + 2 \cdot q^2$