Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
A364800
The number of iterations that n requires to reach 1 under the map x -> A356874(x).
3
0, 1, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
OFFSET
1,3
COMMENTS
a(n) is well-defined since A356874(1) = 1, and A356874(n) < n for n >= 2.
LINKS
FORMULA
a(n) = a(A356874(n)) + 1, for n >= 2.
EXAMPLE
For n = 3 the trajectory is 3 -> 2 -> 1. The number of iterations is 2, thus a(3) = 2.
MATHEMATICA
f[n_] := f[n] = Module[{d = IntegerDigits[n, 2], nd}, nd = Length[d]; Total[d * Fibonacci[Range[nd, 1, -1]]]]; (* A356874 *)
a[n_] := Length@ NestWhileList[f, n, # > 1 &] - 1; Array[a, 100]
PROG
(PARI) f(n) = {my(b = binary(n), nb = #b); sum(i = 1, nb, b[i] * fibonacci(nb - i + 1)); } \\ A356874
a(n) = if(n == 1, 0, a(f(n)) + 1);
CROSSREFS
Cf. A356874.
Similar sequences: A003434, A364801.
Sequence in context: A084556 A084506 A071578 * A157791 A236857 A156874
KEYWORD
nonn,base,easy
AUTHOR
Amiram Eldar, Aug 08 2023
STATUS
approved