<s>[INST] Congruency application I want to prove whether the following is true using congruencies: If $n$ is odd and $3\not | n$, then $n^2\equiv 1\pmod{24}$.
I tried a direct proof.
Let $n=2k+1$ for an integer $k$ such that $3\not| n$, or $3c=n+r$ such that $r=1$ or $r=2$ for an integer $c$. Then in the first case, $3c=n+1$ implies $n\equiv 1\pmod 3$. Or in the second case, $3c=n+2$ implies $n\equiv 2 \pmod 3$. Then $$n^2\equiv 1 \pmod 3 \text{ or } n^2\equiv 4 \pmod 3$$
iff $$3|{n^2-1} \text{ or } 3|n^2-4$$
or $$8n^2\equiv8, 32 \pmod{24}$$
This was the farthest I got. I'm having a hard time going from mod 3 to mod 24 just given the conjunction that $n$ is odd and that $3\not| n$
 [/INST] Let $n$ $=$ $12k + r$ r is not equal to $2,4,6,8$ and $10$ since n is odd and r is not equal to $3$ since r is not divisible by $3$.
Therefore $r={1,5,7,11}$
$Case 1:$ $r = 1$
$n²= 144k²+24k+1$
→$n =24p + 1$  ,$∃p∈ℤ$
$Case 2:$ $r = 5$
$n²= 144k²+24⋅5k+25$
→$n²= 144k²+24k+24+1$
→$n =24p + 1$  ,$∃p∈ℤ$
$Case 3:$ $r = 7$
$n²= 144k²+24⋅7k+49$
→$n²= 144k²+24k+48+1$
→$n =24p + 1$  ,$∃p∈ℤ$
$Case 4:$ $r = 11$
$n²= 144k²+24k+121$
→$n²= 144k²+24⋅11k+120+1$
→$n =24p + 1$  ,$∃p∈ℤ$
Therefore $n^2 \equiv 1 \pmod{24}$.
</s>