login
A204815
Final nonzero digit of n^n in base 5.
2
1, 1, 4, 2, 1, 1, 1, 3, 1, 4, 4, 1, 1, 3, 1, 2, 1, 2, 4, 4, 1, 1, 4, 2, 1, 1, 1, 3, 1, 4, 1, 1, 1, 3, 1, 3, 1, 2, 4, 4, 1, 1, 4, 2, 1, 4, 1, 3, 1, 4, 4, 1, 1, 3, 1, 1, 1, 2, 4, 4, 1, 1, 4, 2, 1, 3, 1, 3, 1, 4, 1, 1, 1, 3, 1, 2, 1, 2, 4, 4, 1, 1, 4, 2, 1
OFFSET
0,3
MATHEMATICA
f[0]=1; f[n_]:=Module[{m=n^n}, While[Mod[m, 5]==0, m=m/5]; Mod[m, 5]]; Table[f[i], {i, 0, 100}]
PROG
(PARI) a(n)=lift(Mod(n/5^valuation(n, 5), 5)^n) \\ Charles R Greathouse IV, Jan 23 2012
CROSSREFS
Sequence in context: A010312 A303599 A068930 * A247642 A144260 A097526
KEYWORD
nonn,easy,base
AUTHOR
STATUS
approved