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”).
%I #30 Sep 22 2023 10:00:25
%S 0,1,6,7,6,5,6,3,6,9,0,1,6,3,6,5,6,7,6,9,0,1,6,7,6,5,6,3,6,9,0,1,6,3,
%T 6,5,6,7,6,9,0,1,6,7,6,5,6,3,6,9,0,1,6,3,6,5,6,7,6,9,0,1,6,7,6,5,6,3,
%U 6,9,0,1,6,3,6,5,6,7,6,9,0,1,6,7,6,5,6,3,6,9,0,1,6,3,6,5,6,7,6,9,0,1,6,7,6,5
%N Final digit (in decimal system) of n^(n^n), i.e., n^(n^n) mod 10.
%C Periodic sequence with period length 20. - _Arkadiusz Wesolowski_, Feb 12 2012
%H <a href="/index/Rec#order_18">Index entries for linear recurrences with constant coefficients</a>, signature (0,1,0,-1,0,1,0,-1,0,1,0,-1,0,1,0,-1,0,1).
%F a(n) = A010879(A002488(n)). - _Michel Marcus_, Aug 04 2015
%p seq(n &^ (n^n) mod 10, n=0..105);
%t Join[{0}, Table[PowerMod[n, n^n, 10], {n, 100}]] (* _Stefan Steinerberger_, Nov 23 2007 *)
%o (PARI) a(n)=if(n%10,lift(Mod(n,10)^lift(Mod(n,20)^n)),0) \\ _Charles R Greathouse IV_, Feb 12 2012
%o (Python)
%o def A120962(n): return pow(n,n**n,10) # _Chai Wah Wu_, Sep 22 2023
%Y Cf. A061505, A229522, A229784.
%K nonn,base,easy
%O 0,3
%A _N. J. A. Sloane_, Jul 19 2006, Oct 26 2007
%E More terms from _Stefan Steinerberger_, Nov 23 2007