login
Integers that need 9 iterations of the map x->A352172(x) to reach 1.
8

%I #11 Mar 10 2022 17:33:10

%S 3,13,30,31,56,65,103,113,130,131,156,165,235,253,300,301,310,311,325,

%T 352,506,516,523,532,560,561,605,615,650,651,1003,1013,1030,1031,1056,

%U 1065,1103,1113,1130,1131,1156,1165,1235,1253,1300,1301,1310,1311,1325,1352,1506,1516

%N Integers that need 9 iterations of the map x->A352172(x) to reach 1.

%e 3 -> 27 -> 2744 -> 11239424 -> 5159780352 -> 54010152000000000 -> 8000000 -> 512 -> 1000 -> 1.

%t f[n_] := (Times @@ Select[IntegerDigits[n], # > 1 &])^3; q[n_, len_] := (v = Nest[f, n, len - 1]) != 1 && f[v] == 1; Select[Range[1516], q[#, 9] &] (* _Amiram Eldar_, Mar 10 2022 *)

%o (PARI) f(n) = vecprod(apply(x->x^3, select(x->(x>1), digits(n)))); \\ A352172

%o isok9(n) = {for (k=1, 9, n = f(n); if ((n==1), return(k==9)););}

%o (Python)

%o from math import prod

%o def A352172(n): return prod(int(d)**3 for d in str(n) if d != '0')

%o def ok(x, iters=9):

%o i = 0

%o while i < iters and x != 1: i, x = i+1, A352172(x)

%o return i == iters and x == 1

%o print([k for k in range(1517) if ok(k)]) # _Michael S. Branicky_, Mar 10 2022

%Y Cf. A352172. Subsequence of A351876.

%Y Cf. A352260, A352261, A352262, A352263, A352264, A352265, A352266, A352268.

%K nonn,base

%O 1,1

%A _Michel Marcus_, Mar 10 2022