<s>[INST] If $a$ and $b$ are integers such that $9$ divides $a^2 + ab + b^2$ then $3$ divides both $a$ and $b$. If $a$ and $b$ are integers such that $9$ divides $a^2 + ab + b^2$ then show that $3$
divides both $a$ and $b$.

can anyone tell me please how to solve these types of problem oe which formula is required
 [/INST] As Glen has shown,  $9\mid \{(a-b)^2+3ab\}$
$\implies 3\mid \{(a-b)^2+3ab\}\implies 3\mid(a-b)^2$
$\implies 3\mid(a-b)\implies 9\mid(a-b)^2$
$\implies 9\mid3ab\implies 3\mid ab$
But if $3$ divides $a,3$ must  divide $b$ and conversely as $3\mid(a-b)$
</s>