A friend recently asked me if I could solve these three problems:
(a) Prove that the sequence $ 1^1, 2^2, 3^3, \dots \pmod{3}$ in other words $\{n^n \pmod{3} \}$ is periodic, and find the length of the period.
(b) Prove that the sequence $1, 2^2, 3^{3^3},\dots \pmod{4}$ i.e. $\{\ ^nn \pmod{4}\}$ is periodic and find the length of the period.
(c) Prove that the sequence $1, 2^2, 3^{3^3},\dots \pmod{5}$ i.e. $\{\ ^nn \pmod{5}\}$ is periodic and find the length of the period.
The first two were not terribly difficult (but might be useful exercises in Fermat's little theorm), but the third one is causing me problems, since my methods are leading to rather a lot of individual cases, and I would be interested to see if anyone here can find a neater way to solve it.
(In (c), I have evaluated the first 15 terms, and not found a period yet - unless I have made a mistake.)