How to prove n^k ≡ n mod 5 if and only if k ≡ 1 mod 4, for all integer n and k is natural?

505 Views Asked by At

I do believe that it has something to do with Fermat's little theorem, and I can prove the backward relationship, but how to prove the forward if? like is N^k-1 necessarily be n ^ 4m?

1

There are 1 best solutions below

0
On

Just try $n =2$ if $k \not \equiv 1 \mod 4$ then $2^k \not \equiv 2 \mod 5$

$\implies$

Suppose $n^k \equiv n\mod 5$ for all $n$. THen $2^k \equiv 2\mod 5$. By FLT we know $2^4 \equiv 1 \mod 5$ and if $k \equiv i \mod 4$ then $2^k\equiv 2^i \mod 4$.

We can simply try $2^0, 2^2, 2^3 \equiv 1, 4, 3 \mod 5$ and not $2$. So $i \equiv k \equiv 1 \mod 4$

$\Leftarrow$

If $\gcd(n, 5) = 1$ then by FLT then for $k \equiv 1 \mod 4$, $n^{4} \equiv 1 \mod 5$ and thus $n^{1 + 4m} \equiv n \mod 5$.

If $\gcd(n, 5) \ne 1$ then $5|n$ and $n\equiv 0 \equiv n^k \mod 5$.