login
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