<s>[INST] Proof by Contradiction: let a,b $\in$Z . Prove that if 3 $\nmid$ a and 3 $\nmid$ b then $3 | a^2 - b^2$ Just wondering if this works for this question, book had a different answer and I couldn't find another answer for the question.
Assume, to the contrary, that 3 | a and 3 | b, then a = 3k, and b = 3x for x,k $\in$ Z, then $a^2 - b^2$ = $(3k)^2 - (3x)^2$ which is equal to $3(3k^2 - 3x^2)$, since $3k^2 - 3x^2$ is an integer, 3 | $a^2 - b^2$ which is a contradiction.
Is this correct?  
 [/INST] If you don't have to use contradiction, here is a direct proof.


*

*$a = 3A+1$ and $b = 3B+1$.
Then $a^2-b^2=(a+b)(a-b)=(a+b)(3A-3B)=3(a+b)(A-B)$.

*$a = 3A+1$ and $b = 3B+2$.
Then $a^2-b^2=(a+b)(a-b)=(3A+3B+3)(a-b)=3(A+B+1)(a-b)$.
The case $a = 3A+2$ and $b = 3B+1$ follows by symmetry.
</s>