1. algebra squares problem

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

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

2. (i)A square of an odd number
$\displaystyle (2k+1)^2=4k^2+4k+1$
If $\displaystyle n = 2k^2+2k$ then $\displaystyle (2k+1)^2=2n+1$ and that shows that $\displaystyle 2n+1$ is the square of an odd number.
Now consider $\displaystyle 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 $\displaystyle 3q+r, r\in \{0,1,2\}$
Square can thus be of the form :
$\displaystyle (3q)^2 = 9 q^2$
$\displaystyle (3q+1)^2 = 9 q^2 +6q +1 = 3(3q^2+2q)+1$
$\displaystyle (3q+2)^2 = 9 q^2 +12q +4 = 3(3q^2+4q+1)+1$
So if $\displaystyle 3n +1$ a square then $\displaystyle n =3q^2+2q \text{ or } n=3q^2+4q+1$
Then n +1 is form (when 3n+1 is odd) $\displaystyle 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) $\displaystyle 3q^2 + 2q + 1 = q^2 + 2q+1 +q^2+ q^2=(q+1)^2 + 2 \cdot q^2$