OFFSET
0,25
COMMENTS
Conjecture: max(a(n)) = 4.
EXAMPLE
For n = 33: a(33) = 4 because for the number 33 there are 4 steps of defined iteration: {3^3 = 27}, {7^2 = 49}, {9^4 = 6561}, {((1^6)^5)^6 = 1}.
PROG
(PARI) f(n) = if (n, my(d=digits(n), r=d[#d]); if (!vecmin(d), return(0)); forstep (k=#d-1, 1, -1, r = r^d[k]; ); r); \\ A175420
findpos(n, list) = {forstep (k=#list, 1, -1, if (list[k] == n, return (k)); ); return (0); }
a(n) = {my(list = List(n), nb = 0); while (n >= 10, n = f(n); my(k=findpos(n, list)); nb++; if (k, if (k==#list-1, if (list[k]<10, return (nb), return(-1)), return(-1)); ); listput(list, n); ); return (nb); } \\ Michel Marcus, Jan 20 2022
CROSSREFS
KEYWORD
sign,base
AUTHOR
Jaroslav Krizek, May 09 2010
STATUS
approved