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.

A225974 Multiplicative persistence with squares of decimal digits: smallest number such that the number of iterations of "multiply digits squared" needed to reach 0 or 1 equals n.

This page as a plain text file.
%I A225974 #16 Nov 05 2022 22:24:19
%S A225974 0,10,25,5,8,6,3,2
%N A225974 Multiplicative persistence with squares of decimal digits: smallest number such that the number of iterations of "multiply digits squared" needed to reach 0 or 1 equals n.
%C A225974 This sequence is probably finite.
%F A225974 a(n) = Min{k >= 0 : A031348(k) = n}. - _Michael S. Branicky_, Oct 13 2022
%e A225974 a(1) is not 1, because 1 takes 0 steps to reach 0 or 1. - _N. J. A. Sloane_, Nov 05 2022
%e A225974 From _Mohammed Yaseen_, Oct 11 2022: (Start)
%e A225974 5 -> 25 -> 4*25 = 100 -> 1*0*0 = 0. So a(3) = 5.
%e A225974 8 -> 64 -> 36*16 = 576 -> 25*49*36 = 44100 -> 16*16*1*0*0 = 0. So a(4) = 8. (End)
%t A225974 lst = {}; n = 0; Do[While[True, k = n; c = 0; While[k > 9, k = Times @@ IntegerDigits[k]^2; c++]; If[c == l, Break[]]; n++]; AppendTo[lst, n], {l, 0, 7}]; lst
%o A225974 (Python)
%o A225974 from math import prod
%o A225974 from itertools import count, islice
%o A225974 def f(n): return prod(map(lambda x: x*x, map(int, str(n))))
%o A225974 def A031348(n):
%o A225974     c = 0
%o A225974     while n not in {0, 1}: n, c = f(n), c+1
%o A225974     return c
%o A225974 def agen():
%o A225974     adict, n = dict(), 0
%o A225974     for k in count(0):
%o A225974         v = A031348(k)
%o A225974         if v not in adict: adict[v] = k
%o A225974         while n in adict: yield adict[n]; n += 1
%o A225974 print(list(islice(agen(), 8))) # _Michael S. Branicky_, Oct 13 2022
%Y A225974 Cf. A003001, A031348, A031349.
%K A225974 nonn,fini,base
%O A225974 0,2
%A A225974 _Michel Lagneau_, May 22 2013
%E A225974 a(3)-a(6) corrected and a(7) from _Mohammed Yaseen_, Oct 11 2022