<s>[INST] For any integer $a$, there is an integer $k$ such that $a^2=3k$ or $a^2=3k+1$ 
Let $a$ be an integer. Prove that there exists an integer $k$ such that $a^2=3k$ or $a^2=3k+1$.

Here is what I did:
I said: $a\in\{\ldots,-3,-2,-1,0,1,2,3,\ldots\}$. When I put 2 into $a^2$, I get $4$ but when I put $2=k$, $3k$, I get the number $4$ on the LHS and the number $6$ on the RHS. But $4$ is not equal to $6$. So how can I prove that $a^2=3k$ equivalent?
I've learned what the division algorithm is. However, when I tried to solve this problem, I got confused.
 [/INST] Note that any integer can be written as one of $3j+0$, $3j+1$, or $3j+2$
$$
\begin{align}
(3j+0)^2&=9j^2&=3k+0&\text{for }k=3j^2\\
(3j+1)^2&=9j^2+6j+1&=3k+1&\text{for }k=3j^2+2j\\
(3j+2)^2&=9j^2+12j+4&=3k+1&\text{for }k=3j^2+4j+1\\
\end{align}
$$
Therefore, the square of any integer can be written as $3k$ or $3k+1$.
Since the tag modular-arithmetic appears in the question, it should be said that the preceding can be written as
$$
\begin{align}
0^2\equiv0\pmod{3}\\
1^2\equiv1\pmod{3}\\
2^2\equiv1\pmod{3}
\end{align}
$$
</s>