%I #71 Oct 20 2023 10:52:52
%S 1,4,7,6,5,6,3,6,9,0,1,6,3,6,5,6,7,4,9,0,1,4,7,6,5,6,3,6,9,0,1,6,3,6,
%T 5,6,7,4,9,0,1,4,7,6,5,6,3,6,9,0,1,6,3,6,5,6,7,4,9,0,1,4,7,6,5,6,3,6,
%U 9,0,1,6,3,6,5,6,7,4,9,0,1,4,7,6,5,6,3,6,9,0,1,6,3,6,5,6,7,4,9,0
%N Final digit of n^n.
%C Cyclic with a period of 20.
%C Also decimal expansion of 147656369016365674900/(10^20-1). - _Bruno Berselli_, Sep 27 2021
%D R. Euler and J. Sadek, "A Number That Gives The Units Of n^n", Journal of Recreational Mathematics, vol. 29(3), 1998, pp. 203-4.
%H Hung Viet Chu, <a href="https://arxiv.org/abs/1908.03855">New Transcendental Numbers from Certain Sequences</a>, arXiv:1908.03855 [math.NT], 2019. Mentions this sequence.
%H Gregory P. Dresden, <a href="http://www.jstor.org/stable/27643091">Three transcendental numbers from the last non-zero digits of n^n, F_n and n!</a>, Mathematics Magazine, vol. 81, 2008, pp. 96-105.
%H Gregory Dresden, <a href="https://arxiv.org/abs/1904.10274">Two Irrational Numbers That Give the Last Non-Zero Digits of n! and n^n</a>, arXiv:1904.10274 [math.NT], 2019.
%H Jose María Grau and A. M. Oller-Marcen, <a href="http://arxiv.org/abs/1203.4066">On the last digit and the last non-zero digit of n^n in base b</a>, arXiv:1203.4066 [math.NT], 2012.
%H Jose María Grau and A. M. Oller-Marcen, <a href="http://pdf.medrang.co.kr/kms01/BKMS/51/BKMS-51-5-1325-1337.pdf">On the last digit and the last non-zero digit of n^n in base b</a>, Bull. Korean Math. Soc. 51 (2014), No. 5, pp. 1325-1337.
%H <a href="/index/Fi#final">Index entries for sequences related to final digits of numbers</a>
%H <a href="/index/Rec#order_20">Index entries for linear recurrences with constant coefficients</a>, signature (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1).
%p seq(n &^ n mod 10, n=1..120);
%t Table[PowerMod[n, n, 10], {n, 1, 100}]
%o (Magma) [Modexp(n, n, 10): n in [1..100]]; // _Bruno Berselli_, Sep 27 2021
%o (PARI) a(n)=lift(Mod(n,10)^n) \\ _Charles R Greathouse IV_, Dec 29 2012
%o (Python)
%o def a(n): return pow(n, n, 10)
%o print([a(n) for n in range(1, 101)]) # _Michael S. Branicky_, Sep 13 2022
%Y Cf. A000312, A061505, A116081.
%Y n^n mod 3..9: A204688, A204689, A204690, A204671, A204693, A204694, A204695.
%K nonn,base,easy
%O 1,2
%A _Robert G. Wilson v_, Aug 30 2000