A364802 Smallest number that reaches 1 after n iterations of the map x -> A356874(x).
1, 2, 3, 5, 11, 29, 117, 879, 15279, 963957, 392158939, 2059426052079
Offset: 0
Programs
-
Mathematica
f[n_] := f[n] = Module[{d = IntegerDigits[n, 2], nd}, nd = Length[d]; Total[d * Fibonacci[Range[nd, 1, -1]]]]; (* A356874 *) iternum[n_] := Length@ NestWhileList[f, n, # > 1 &] - 1; (* A364800 *) seq[kmax_] := Module[{s = {}, imax = -1, i}, Do[i = iternum[k]; If[i > imax, imax = i; AppendTo[s, k]], {k, 1, kmax}]; s] seq[10^6]
-
PARI
f(n) = {my(b = binary(n), nb = #b); sum(i = 1, nb, b[i] * fibonacci(nb - i + 1));} \\ A356874 iternum(n) = if(n == 1, 0, iternum(f(n)) + 1); \\ A364800 lista(kmax) = {my(imax = -1, i1); for(k = 1, kmax, i = iternum(k); if(i > imax, imax = i; print1(k, ", ")));}
Extensions
a(11) from Martin Ehrenstein, Aug 26 2023
Comments