OFFSET
1,2
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000
José María Grau and Antonio M. Oller-Marcén, On the last digit and the last non-zero digit of n^n in base b, arXiv preprint arXiv:1203.4066 [math.NT], 2012.
PROG
(Python)
from gmpy2 import mpz, digits
def A260031(n):
s = digits(mpz(n)**mpz(n), 12)
t = s[-1]
while t == '0':
s = s[:-1]
t = s[-1]
return int(t, 12) # Chai Wah Wu, Jul 19 2015
(Haskell)
import Math.NumberTheory.Moduli (powerMod)
a260031 n = if x > 0 then x else f $ div (n ^ n) 12
where x = powerMod n n 12
f z = if m == 0 then f z' else m
where (z', m) = divMod z 12
-- Reinhard Zumkeller, Jul 19 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Jul 19 2015
EXTENSIONS
More terms from Chai Wah Wu, Jul 19 2015
STATUS
approved