%I #12 May 13 2013 01:50:02
%S 1,1,4,3,4,5,1,1,4,3,4,5,4,1,4,3,4,5,3,1,4,3,4,5,4,1,4,3,4,5,1,1,4,3,
%T 4,5,1,1,4,3,4,5,1,1,4,3,4,5,4,1,4,3,4,5,3,1,4,3,4,5,4,1,4,3,4,5,1,1,
%U 4,3,4,5,4,1,4,3,4,5,1,1,4,3,4,5,4
%N Final nonzero digit of n^n in base 6.
%t f[0]=1;f[n_]:=Module[{m=n^n},While[Mod[m,6]==0,m=m/6];Mod[m,6]];Table[f[i],{i,0,100}]
%o (PARI) a(n)=lift(Mod(n/6^valuation(n,6),6)^n) \\ _Charles R Greathouse IV_, Jan 23 2012
%K nonn,easy,base
%O 0,3
%A _José María Grau Ribas_, Jan 19 2012
