This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A260031 #21 Apr 06 2020 02:43:56 %S A260031 1,4,3,4,5,3,7,4,9,4,11,1,1,4,3,4,5,3,7,4,9,4,11,4,1,4,3,4,5,3,7,4,9, %T A260031 4,11,9,1,4,3,4,5,3,7,4,9,4,11,4,1,4,3,4,5,3,7,4,9,4,11,1,1,4,3,4,5,3, %U A260031 7,4,9,4,11,9,1,4,3,4,5,3,7,4,9,4,11,1 %N A260031 Final nonzero digit of n^n in base 12. %H A260031 Chai Wah Wu, <a href="/A260031/b260031.txt">Table of n, a(n) for n = 1..10000</a> %H A260031 José María Grau and Antonio M. Oller-Marcén, <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 preprint arXiv:1203.4066 [math.NT], 2012. %o A260031 (Python) %o A260031 from gmpy2 import mpz, digits %o A260031 def A260031(n): %o A260031 s = digits(mpz(n)**mpz(n),12) %o A260031 t = s[-1] %o A260031 while t == '0': %o A260031 s = s[:-1] %o A260031 t = s[-1] %o A260031 return int(t,12) # _Chai Wah Wu_, Jul 19 2015 %o A260031 (Haskell) %o A260031 import Math.NumberTheory.Moduli (powerMod) %o A260031 a260031 n = if x > 0 then x else f $ div (n ^ n) 12 %o A260031 where x = powerMod n n 12 %o A260031 f z = if m == 0 then f z' else m %o A260031 where (z', m) = divMod z 12 %o A260031 -- _Reinhard Zumkeller_, Jul 19 2015 %Y A260031 Cf. A174824, A204819, A230024. %Y A260031 Cf. A000312, A010881. %K A260031 nonn %O A260031 1,2 %A A260031 _N. J. A. Sloane_, Jul 19 2015 %E A260031 More terms from _Chai Wah Wu_, Jul 19 2015