cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A031346 Multiplicative persistence: number of iterations of "multiply digits" needed to reach a number < 10.

This page as a plain text file.
%I A031346 #63 Jul 06 2025 11:09:11
%S A031346 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 A031346 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 A031346 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 A031346 Multiplicative persistence: number of iterations of "multiply digits" needed to reach a number < 10.
%D A031346 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.
%D A031346 James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 35.
%H A031346 T. D. Noe, <a href="/A031346/b031346.txt">Table of n, a(n) for n = 0..10000</a>
%H A031346 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 A031346 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 A031346 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 A031346 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 A031346 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/MultiplicativePersistence.html">Multiplicative Persistence</a>.
%F A031346 Probably bounded, see A003001. - _Charles R Greathouse IV_, Nov 15 2022
%e A031346 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 A031346 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 A031346 Table[Length[NestWhileList[Times@@IntegerDigits[#]&,n,#>=10&]],{n,0,100}]-1 (* _Harvey P. Dale_, Aug 27 2016 *)
%o A031346 (Python)
%o A031346 from operator import mul
%o A031346 from functools import reduce
%o A031346 def A031346(n):
%o A031346     mp = 0
%o A031346     while n > 9:
%o A031346         n = reduce(mul, (int(d) for d in str(n)))
%o A031346         mp += 1
%o A031346     return mp
%o A031346 # _Chai Wah Wu_, Aug 23 2014
%o A031346 (PARI) a007954(n) = my(d=digits(n)); prod(i=1, #d, d[i])
%o A031346 a(n) = my(k=n, i=0); while(#Str(k) > 1, k=a007954(k); i++); i \\ _Felix Fröhlich_, Jul 17 2016
%o A031346 (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 A031346 Cf. A007954 (product of decimal digits of n).
%Y A031346 Cf. A010888 (additive digital root of n).
%Y A031346 Cf. A031286 (additive persistence of n).
%Y A031346 Cf. A031347 (multiplicative digital root of n).
%Y A031346 Cf. A263131 (ordinal transform).
%Y A031346 Cf. A003001.
%K A031346 nonn,easy,base
%O A031346 0,26
%A A031346 _Eric W. Weisstein_