A175402 a(n) is the number of iterations of {r -> (((D_1^D_2)^D_3)^...)^D_k, where D_k is the k-th decimal digit of r} needed to reach a one-digit number, starting at r = n.
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 2, 3, 4, 1, 1, 1, 3, 2, 3, 3, 3, 3, 2, 1, 1, 2, 3, 3, 2, 2, 2, 3, 3, 1, 1, 3, 2, 3, 3, 2, 3, 2, 2, 1, 1, 4, 4, 2, 3, 3, 3, 2, 2, 1, 1, 4, 4, 2, 2, 2, 3, 2, 2, 1, 1, 3, 4, 2, 3, 3, 2, 2, 2, 1, 1, 2, 3, 3, 2, 3, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 0
Examples
For n = 29: a(29) = 4 because for the number 29 there are 4 steps of defined iteration: {2^9 = 512}, {(5^1)^2 = 25}, {2^5 = 32}, {3^2 = 9}.
Programs
-
PARI
iter(n)=my(v=eval(Vec(Str(n))));v[1]^prod(i=2,#v,v[i]) a(n)=my(k=0);while(n>9,k++;n=iter(n));k
Extensions
Corrected, extended, comment, and program from Charles R Greathouse IV, Aug 03 2010
Comments