login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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