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.

A031348 2-multiplicative persistence: number of iterations of "multiply 2nd powers of digits" needed to reach 0 or 1.

This page as a plain text file.
%I A031348 #31 Feb 16 2025 08:32:36
%S A031348 0,7,6,6,3,5,5,4,5,1,1,7,6,6,3,5,5,4,5,1,7,6,5,4,2,4,5,3,4,1,6,5,5,4,
%T A031348 3,4,4,3,4,1,6,4,4,3,2,3,3,2,4,1,3,2,3,2,3,2,3,2,2,1,5,4,4,3,2,4,5,2,
%U A031348 4,1,5,5,4,3,3,5,2,5,4,1,4,3,3,2,2,2,5,2,3,1,5,4,4,4,2,4,4,3,3
%N A031348 2-multiplicative persistence: number of iterations of "multiply 2nd powers of digits" needed to reach 0 or 1.
%C A031348 From _Mohammed Yaseen_, Nov 08 2022: (Start)
%C A031348 Is 7 the maximal 2-multiplicative persistence?
%C A031348 Are A199986 the only numbers whose 2-multiplicative persistence is 7?
%C A031348 These hold true for n up to 10^9. (End)
%D A031348 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 A031348 Seiichi Manyama, <a href="/A031348/b031348.txt">Table of n, a(n) for n = 1..10000</a>
%H A031348 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 A031348 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 A031348 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/MultiplicativePersistence.html">Multiplicative Persistence</a>
%e A031348 a(14) = 6 because
%e A031348 14 -> 1^2 * 4^2 = 16;
%e A031348 16 -> 1^2 * 6^2 = 36;
%e A031348 36 -> 3^2 * 6^2 = 324;
%e A031348 324 -> 3^2 * 2^2 * 4^2 = 576;
%e A031348 576 -> 5^2 * 7^2 * 6^2 = 44100;
%e A031348 44100 -> 0 => the trajectory is 14 -> 16 -> 36 -> 324 -> 576 -> 44100 -> 0 with 6 iterations. - _Michel Lagneau_, May 22 2013
%t A031348 m2pd[n_]:=Length[NestWhileList[Times@@(IntegerDigits[#]^2)&,n,#>1&]]-1; Array[m2pd,100] (* _Harvey P. Dale_, Apr 19 2020 *)
%o A031348 (PARI) f(n) = my(d=digits(n)); prod(k=1, #d, d[k]^2);
%o A031348 a(n) = if (n==1, 0, my(nb=1); while(((new = f(n)) > 1), n = new; nb++); nb); \\ _Michel Marcus_, Jun 13 2018
%o A031348 (Python)
%o A031348 from math import prod
%o A031348 from itertools import count, islice
%o A031348 def f(n): return prod(map(lambda x: x*x, map(int, str(n))))
%o A031348 def a(n):
%o A031348     c = 0
%o A031348     while n not in {0, 1}: n, c = f(n), c+1
%o A031348     return c
%o A031348 print([a(n) for n in range(1, 100)]) # _Michael S. Branicky_, Oct 13 2022
%Y A031348 Cf. A031346.
%K A031348 nonn,base
%O A031348 1,2
%A A031348 _Eric W. Weisstein_