OFFSET
0,3
LINKS
Stefano Spezia, Table of n, a(n) for n = 0..10000
FORMULA
a(n) = (((D_k^D_(k-1))^D_(k-2))^...)^D_1, where D_k = k-th digit D of number n and k = the number of digits of number n in decimal expansion of n (A055642).
EXAMPLE
For n = 33: a(33) = 27 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} and the 1st step of the iteration ends with 27.
MAPLE
A175420 := proc(n) local dgs, a, i ; if n = 0 then return 0 ; end if; dgs := convert(n, base, 10) ; a := op(1, dgs) ; for i from 2 to nops(dgs) do a := a^ op(i, dgs) ; end do: a ; end proc: seq(A175420(n), n=0..120) ; # R. J. Mathar, May 12 2010
MATHEMATICA
Unprotect[Power]; Power[0, 0] = 1; Protect[Power]; a[0]=0; a[n_]:=If[(len=IntegerLength[n])==1, n, Last[list=IntegerDigits[n]]^Product[Part[Drop[list, -1], i], {i, len-1}]]; Array[a, 67, 0] (* Stefano Spezia, Feb 25 2024 *)
PROG
(PARI) a(n) = if (n, my(d=digits(n), r=d[#d]); forstep (k=#d-1, 1, -1, r = r^d[k]; ); r); \\ Michel Marcus, Jan 20 2022
CROSSREFS
KEYWORD
AUTHOR
Jaroslav Krizek, May 09 2010
EXTENSIONS
More terms from R. J. Mathar, May 12 2010
STATUS
approved