<s>[INST] $24$ divides $a^2+23$ 
Prove that $24$ divides $a^2 + 23$ if $a$ is not divisible by $2$ or $3$.

Well $a^2=8k+1$
for some $k$.
So, $$a^2+23 = (8k+1)+23=8(k+3)$$
So, $8$ divides $a^2+23$.
Now can $3$ divide $a^2+ 23$ so that in the end $24$ divides $a^2+23$?
 [/INST] $a$ doesn't divide $3$ so:
$$
a\equiv\pm 1[3]\\
a^2 \equiv 1[3]\\
a^2+23 \equiv 24\equiv 0[3]
$$
So $3$ divides $a^2+23$ and since you correctly showed that $8|a^2+23$ and knowing that $\gcd(8,3)=1$ So :
$$
24|a^2+23
$$
I used the property that:
$$
a|b\quad \mathrm{and}\quad b|c \Longrightarrow \mathrm{lcm}(a,b)|c\\
ab=\gcd(a,b)\mathrm{lcm}(a,b)
$$
</s>