Originally Posted by

**melese** It must be that $\displaystyle 1+12n^2=k^2$ for some integer $\displaystyle k$; $\displaystyle k$ is odd and $\displaystyle m=2(k+1)$.

Then $\displaystyle 12n^2=(k-1)(k+1)$, where $\displaystyle (k-1,k+1)=2$; therefore, $\displaystyle (\frac{k-1}{2},\frac{k+1}{2})=1$.

For $\displaystyle 3n^2=\frac{k-1}{2}\cdot\frac{k+1}{2}$ we consider two cases (we wish to keep relatively prime factors.).

If $\displaystyle 3|(k+1)/2}$, write $\displaystyle (3n)^2=\frac{k-1}{2}\frac{3k+3}{2}$, both factors are perfect squares. We have $\displaystyle 3(k+1)=2t^2$ for some integer $\displaystyle t$ and $\displaystyle 3$ must divide $\displaystyle t$; hence, $\displaystyle k+1=2(t/3)^2$. Subsitute, $\displaystyle m=2(k+1)=4(t/3)^2$.

If $\displaystyle 3|(k-1)/2$, write $\displaystyle (3n)^2=\frac{3k-3}{2}\frac{k+1}{2}$, both factors are perfect squares, i.e. $\displaystyle k+1=2t^2$. Then $\displaystyle m=2(1+k)=4t^2$.