%I #16 Jan 20 2022 17:32:00
%S 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,-1,-1,3,3,2,1,1,1,
%T 4,3,-1,-1,3,3,3,1,1,2,2,3,3,3,2,2,2,1,1,2,3,2,4,3,2,3,2,1,1,3,3,2,3,
%U 3,3,3,2,1,1,4,3,3,3,3,3,2,3,1,1,3,2,3,2,3,2,2,2,1,1,3,3,3,3,2,2,2,2
%N a(n) is the number of steps of iterations of {(((D_k^D_(k-1))^D_(k-2))^...)^D_1, where D_k is the k-th digit D of number r and k is the number of digits of number r in decimal expansion of r (A055642)} needed to reach a single-digit number starting at r = n, or a(n) = -1 if a single-digit number is never reached.
%C Conjecture: max(a(n)) = 4.
%e 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}.
%o (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
%o findpos(n, list) = {forstep (k=#list, 1, -1, if (list[k] == n, return (k));); return (0);}
%o 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
%Y Cf. A175419, A175420, A175421, A175422, A175423, A175425, A175426, A175427.
%K sign,base
%O 0,25
%A _Jaroslav Krizek_, May 09 2010