%I #58 Nov 15 2022 11:45:44
%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,1,2,2,2,2,2,1,1,1,1,
%T 2,2,2,2,2,3,1,1,1,2,2,2,2,3,2,3,1,1,2,2,2,3,2,3,2,3,1,1,2,2,2,2,3,2,
%U 3,3,1,1,2,2,3,3,2,4,3,3,1,1,2,2,2,2,3,3,3,3,1,1,2,3,3,3,3,3,3,2
%N Multiplicative persistence: number of iterations of "multiply digits" needed to reach a number < 10.
%D M. Gardner, Fractal Music, Hypercards and More Mathematical Recreations from Scientific American, Persistence of Numbers, pp. 120-1; 186-7, W. H. Freeman NY 1992.
%H T. D. Noe, <a href="/A031346/b031346.txt">Table of n, a(n) for n = 0..10000</a>
%H Gabriel Bonuccelli, Lucas Colucci, and Edson de Faria, <a href="https://arxiv.org/abs/2009.01114">On the Erdős-Sloane and Shifted Sloane Persistence</a>, arXiv:2009.01114 [math.NT], 2020.
%H Eric Brier, Christophe Clavier, Linda Gutsche and David Naccache, <a href="https://arxiv.org/abs/2110.04263">The Multiplicative Persistence Conjecture Is True for Odd Targets</a>, arXiv:2110.04263 [math.NT], 2021.
%H M. R. Diamond, <a href="http://www.markdiamond.com.au/download/joous-3-1-1.pdf">Multiplicative persistence base 10: some new null results</a>.
%H N. J. A. Sloane, <a href="http://neilsloane.com/doc/persistence.html">The persistence of a number</a>, J. Recreational Math., 6 (1973), 97-98.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/MultiplicativePersistence.html">Multiplicative Persistence</a>
%F Probably bounded, see A003001. - _Charles R Greathouse IV_, Nov 15 2022
%e For n = 999: A007954(999) = 729, A007954(729) = 126, A007954(126) = 12 and A007954(12) = 2. The fourth iteration of "multiply digits" yields a single-digit number, so a(999) = 4. - _Felix Fröhlich_, Jul 17 2016
%p A007954 := proc(n) return mul(d, d=convert(n, base, 10)): end: A031346 := proc(n) local k,m: k:=0:m:=n: while(length(m)>1)do m:=A007954(m):k:=k+1: od: return k: end: seq(A031346(n),n=0..100); # _Nathaniel Johnston_, May 04 2011
%t Table[Length[NestWhileList[Times@@IntegerDigits[#]&,n,#>=10&]],{n,0,100}]-1 (* _Harvey P. Dale_, Aug 27 2016 *)
%o (Python)
%o from operator import mul
%o from functools import reduce
%o def A031346(n):
%o mp = 0
%o while n > 9:
%o n = reduce(mul, (int(d) for d in str(n)))
%o mp += 1
%o return mp
%o # _Chai Wah Wu_, Aug 23 2014
%o (PARI) a007954(n) = my(d=digits(n)); prod(i=1, #d, d[i])
%o a(n) = my(k=n, i=0); while(#Str(k) > 1, k=a007954(k); i++); i \\ _Felix Fröhlich_, Jul 17 2016
%o (Magma) f:=func<n|&*Intseq(n)>; a:=[]; for n in [0..100] do s:=0; k:=n; while k ge 10 do s:=s+1; k:=f(k); end while; Append(~a,s); end for; a; // _Marius A. Burtea_, Jan 12 2020
%Y Cf. A007954 (product of decimal digits of n).
%Y Cf. A010888 (additive digital root of n).
%Y Cf. A031286 (additive persistence of n).
%Y Cf. A031347 (multiplicative digital root of n).
%Y Cf. A263131 (ordinal transform).
%Y Cf. A003001.
%K nonn,easy,base
%O 0,26
%A _Eric W. Weisstein_