<s>[INST] Prove that the square of an integer $a$ is of the form $a^2=3k$, or $a^2=3k+1$, where $k\in \mathbb{Z} $ Here's my attempt to prove this. I'm not sure about it, but i hope i'm correct.
Let $a=λ, λ\in \mathbb{Z}$. Then $a^2=λ^2=3\frac{λ^2}{3}$.
When $λ^2$ is divided by 3 there are three possible remainders $0,1,2$. So 
$$ λ^2=3k \lor λ^2=3k+1 \lor λ^2=3k+2   $$


*

*$ λ^2=3k \rightarrow a^2=3\frac{3k}{3}=3k $

*$ λ^2=3k+1 \rightarrow a^2=3\frac{3k+1}{3}=3k+1 $

*$ λ^2=3k+2 \rightarrow a^2=3\frac{3k+2}{3}=3k+2=3μ, μ\in \mathbb{Z} $


Therefore $$a^2=
 \begin{cases} 
      3k \\
      3k+1
   \end{cases}
$$
where $k$ is an integer.
Can someone verify this? Any help will be appreciated. Thanks in advance!
 [/INST] I don't understand how you eliminated the $3k+2 $ case. It might be easier just to look at the cases $a=3\lambda, a=3\lambda+1, a=3\lambda+2$ and multiply out. as follows:
When $a$ is divided by $3$, there are three possible remainders over an exact multiple of $3$: $0, 1,$ and $2$. Therefore consider the three cases 


*

*$a=3\lambda$

*$a=3\lambda+1$

*$a=3\lambda+2$ 


Then $a^2$ calculates out as follows:


*

*$a=3\lambda \implies a^2 = 9 \lambda^2 = 3(3 \lambda^2)$

*$a=3\lambda+1\implies a^2 = 9 \lambda^2 + 6\lambda + 1 = 3(3 \lambda^2 + 2\lambda)+1$

*$a=3\lambda+2\implies a^2 = 9 \lambda^2 + 12\lambda + 4 = 3(3 \lambda^2 + 6\lambda+1)+1$


giving a suitable value for $k$ in each case.
</s>