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.

A351327 Numbers whose trajectory under iteration of the product of squares of nonzero digits map includes 1.

This page as a plain text file.
%I A351327 #51 Mar 18 2023 08:49:14
%S A351327 1,5,10,11,15,25,50,51,52,100,101,105,110,111,115,125,150,151,152,205,
%T A351327 215,250,251,255,357,375,455,500,501,502,510,511,512,520,521,525,537,
%U A351327 545,552,554,573,735,753,1000,1001,1005,1010,1011,1015,1025,1050,1051
%N A351327 Numbers whose trajectory under iteration of the product of squares of nonzero digits map includes 1.
%C A351327 To determine whether a given number k is a term of this sequence, start with k, take the square of the product of its nonzero digits, apply the same process to the result, and continue until 1 is reached or a loop is entered. If 1 is reached, k is a term of this sequence.
%C A351327 Every power 10^k is a term of this sequence.
%C A351327 If k is a term, the numbers obtained by inserting zeros anywhere in k are terms.
%C A351327 If k is a term, the numbers obtained by inserting ones anywhere in k are terms.
%C A351327 If k is a term, each distinct permutation of the digits of k gives another term.
%C A351327 If k is a term, the number of iterations required to converge to 1 is less than or equal to 3 (conjectured).
%C A351327 From _Michael S. Branicky_, Feb 07 2022: (Start)
%C A351327 The product of squares of nonzero digits map, f, has fixed points given in A115385.
%C A351327 The map f has (at least) the following cycles:
%C A351327   - 324, 576, 44100, 256, 3600;
%C A351327   - 11664, 20736, 63504, 129600;
%C A351327   - 15876, 2822400, 65536, 7290000;
%C A351327   - 5308416, 8294400;
%C A351327   - 49787136000000, 64524128256, 849346560000, 386983526400, 55725627801600.
%C A351327 (End)
%H A351327 Luca Onnis, <a href="https://arxiv.org/abs/2203.03381">On a variant of the happy numbers and their generalizations</a>, arXiv:2203.03381 [math.GM], 2022.
%e A351327 255 is a term of the sequence: the square of the product of its nonzero digits is (2*5*5)^2=2500, the square of the product of its nonzero digits is (2*5)^2=100, and the square of the product of its nonzero digits is 1^2=1.
%e A351327 2 is not a term of the sequence because its trajectory under the map is 2 -> 4 -> 16 -> 36 -> 324 -> 576 -> 44100 -> 256 -> 3600 -> 324 (reached earlier), so it enters a loop and never reaches 1.
%p A351327 b:= proc() false end:
%p A351327 q:= proc(n) local m, s; m, s:= n, {};
%p A351327       do if m=1 then return true
%p A351327        elif m in s or b(m) then b(n):= true; return false
%p A351327        else s, m:= {s[], m}, mul(max(1, i)^2, i=convert(m, base, 10))
%p A351327          fi
%p A351327       od
%p A351327     end:
%p A351327 select(q, [$1..2000])[];  # _Alois P. Heinz_, Feb 11 2022
%t A351327 Select[Range[1000],
%t A351327 FixedPoint[
%t A351327     Product[ReplaceAll[0 -> 1][IntegerDigits[#]][[i]]^2, {i, 1,
%t A351327        Length[ReplaceAll[0 -> 1][IntegerDigits[#]]]}] &, #, 10] == 1 &]
%o A351327 (Python)
%o A351327 from math import prod
%o A351327 def psd(n): return prod(int(d)**2 for d in str(n) if d != "0")
%o A351327 def ok(n):
%o A351327     seen = set()
%o A351327     while n not in seen: # iterate until fixed point or in cycle
%o A351327         seen.add(n)
%o A351327         n = psd(n)
%o A351327     return n == 1
%o A351327 def aupto(n): return [k for k in range(1, n+1) if ok(k)]
%o A351327 print(aupto(1205)) # _Michael S. Branicky_, Feb 07 2022
%o A351327 (PARI) f(n) = vecprod(apply(d -> if (d, d^2, 1), digits(n)))
%o A351327 is(n) = { my (m=f(n)); while (1, if (n==1, return (1), n==m, return (0), n=f(n); m=f(f(m)))) } \\ _Rémy Sigrist_, Feb 11 2022
%Y A351327 Cf. A007770, A051801, A115385.
%K A351327 nonn,base
%O A351327 1,2
%A A351327 _Luca Onnis_, Feb 07 2022