OFFSET
1,10
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
229 = prime(50) -> 2*2*9 = 36 -> 3*6 = 18 -> 1*8 = 8 -> persistence(229) = 3 = a(50).
MAPLE
P:=proc(n) local i, k, w, ok, cont, x; for i from 1 by 1 to n do k:=ithprime(i); w:=1; ok:=1; x:=k; if k<10 then print(0); else cont:=1; while ok=1 do while k>0 do w:=w*(k-(trunc(k/10)*10)); k:=trunc(k/10); od; if w<10 then ok:=0; print(cont); else cont:=cont+1; k:=w; w:=1; fi; od; fi; od; end: P(100);
MATHEMATICA
s={}; Do[i=0; m=Prime[n]; While[m!=Times@@IntegerDigits[m], m=Times@@IntegerDigits[m]; i++]; AppendTo[s, i], {n, 100}]; s (* James C. McMahon, Feb 03 2025 *)
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
Paolo P. Lava and Giorgio Balzarotti, Jun 14 2007
EXTENSIONS
Offset corrected by Alois P. Heinz, Feb 03 2025
STATUS
approved