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”).

A204697
Final nonzero digit of n^n in base 3.
2
1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1
OFFSET
0,6
MATHEMATICA
f[0]=1; f[n_]:=Module[{m=n^n}, While[Mod[m, 3]==0, m=m/3]; Mod[m, 3]]; Table[f[i], {i, 0, 84}]
PROG
(PARI) a(n)=lift(Mod(n/3^valuation(n, 3), 3)^n) \\ Charles R Greathouse IV, Jan 23 2012
CROSSREFS
Sequence in context: A132587 A318930 A235748 * A208576 A307897 A008651
KEYWORD
nonn,base,easy
AUTHOR
STATUS
approved