<s>[INST] Proving the remainder is $1$ if the square of a prime is divided by $12$ Given, $p$ is a prime number and $p>3$. How do we prove that the remainder $r$ is always $1$ if $p^2$ is divided by $12$?
 [/INST] If $(a,12)=1, (a,3)=1$ and $ (a,2)=1$
$(a,3)=1\implies a\equiv\pm1\pmod 3\implies a^2\equiv1\pmod 3$
$(a,2)=1\implies a$ is odd $=2b+1$(say) where $b$ is some integer
$(2b+1)^2=4b^2+4b+1=8\frac{b(b+1)}2+1\equiv1\pmod 8$
$\implies a^2\equiv1\pmod { \text{lcm}(3,8)}$
Now, lcm $(3,8)=24$
</s>