A352261 Integers that need 3 iterations of the map x->A352172(x) to reach 1.
5, 8, 15, 18, 24, 42, 50, 51, 80, 81, 105, 108, 115, 118, 124, 142, 150, 151, 180, 181, 204, 214, 222, 240, 241, 255, 258, 285, 402, 412, 420, 421, 445, 454, 500, 501, 510, 511, 525, 528, 544, 552, 582, 800, 801, 810, 811, 825, 852, 1005, 1008, 1015, 1018, 1024, 1042, 1050
Offset: 1
Examples
5 -> 125 -> 1000 -> 1.
Crossrefs
Programs
-
Mathematica
f[n_] := (Times @@ Select[IntegerDigits[n], # > 1 &])^3; q[n_, len_] := (v = Nest[f, n, len - 1]) != 1 && f[v] == 1; Select[Range[1050], q[#, 3] &] (* Amiram Eldar, Mar 10 2022 *)
-
PARI
f(n) = vecprod(apply(x->x^3, select(x->(x>1), digits(n)))); \\ A352172 isok3(n) = {for (k=1, 3, n = f(n); if ((n==1), return(k==3)););}
-
Python
from math import prod def A352172(n): return prod(int(d)**3 for d in str(n) if d != '0') def ok(x, iters=3): i = 0 while i < iters and x != 1: i, x = i+1, A352172(x) return i == iters and x == 1 print([k for k in range(1051) if ok(k)]) # Michael S. Branicky, Mar 10 2022