OFFSET
1,2
LINKS
FORMULA
a(n) == 7 (mod 9) for n >= 5. - Hugo Pfoertner, Nov 15 2020
EXAMPLE
for n=6, a(6) = sum_of_digits(7^7) = sum_of_digits(823543) = 25
MATHEMATICA
a[1]:=1; a[2]:=2; a[n_]:=Total[IntegerDigits[a[n-1]^a[n-2]]]; Array[a, 19] (* Stefano Spezia, Nov 15 2020 *)
PROG
(SageMath)
a, b=1, 2
L=[a, b]
for n in [1..17]:
c=b^a
c=sum(c.digits())
L.append(c)
a, b=b, c
print(L)
(PARI) a338917(nmax)={my(x=vector(nmax)); x[1]=1; x[2]=2; for(k=3, nmax, x[k]=sumdigits(x[k-1]^x[k-2])); x};
a338917(18) \\ Hugo Pfoertner, Nov 15 2020
CROSSREFS
KEYWORD
nonn,base,more
AUTHOR
Sean Lestrange, Nov 15 2020
EXTENSIONS
a(20) from Hugo Pfoertner, Nov 15 2020
a(21) from Chai Wah Wu, Nov 19 2020
STATUS
approved