login
A338917
a(n) = sum_of_digits(a(n-1)^a(n-2)) where a(1)=1 and a(2)=2.
1
1, 2, 2, 4, 7, 7, 25, 34, 151, 331, 1690, 3265, 26449, 64528, 574513, 1671208, 16090657, 54199564, 559922497, 2133503863, 23506132363
OFFSET
1,2
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
Cf. A007953.
Sequence in context: A244011 A065968 A105669 * A256963 A355306 A019657
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