If an integer $n$ is coprime to $6$, then prove that $n^2$ leaves remainder 1 on division by 24
I know that $n$ can be written as $6k+1$ and $6k+5$, but how to proceed?
If an integer $n$ is coprime to $6$, then prove that $n^2$ leaves remainder 1 on division by 24
I know that $n$ can be written as $6k+1$ and $6k+5$, but how to proceed?
$\implies n$ is of the form $6m\pm1$ where $m$ is any integer
Now $(6m\pm1)^2=24m^2+24\cdot\dfrac{m(m\pm1)}2+1$
as $m(m\pm1)$ are even being products of two consecutive integers.
Let $\gcd(n,6) = 1$. We want $n^{2} = 24q + 1$ for some integer $q$. Note that it is equivalent to $n^{2}-1 = (n-1)(n+1) = 24q$. If $n = 6k+1$ for some integer $k$, then $(n-1)(n+1) = 36k^{2} + 12k = 24q$, that is $k(3k+1) = 2q$. Note that $k, 3k+1$ cannot be both odd. Then we find $q = k(3k+1)/2$.
Likewise, if $n = 6k+5$ for some integer $k$, then we are led to consider $(k+1)(3k+2) = 2q$. Again $k+1, 3k+2$ cannot be both odd, so taking $q := (k+1)(3k+2)/2$ suffices.