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.

A364801 The number of iterations that n requires to reach a fixed point under the map x -> A022290(x).

This page as a plain text file.
%I A364801 #13 Aug 10 2023 12:23:56
%S A364801 0,0,0,0,1,2,3,4,3,4,5,4,4,5,6,5,4,5,6,5,5,5,6,7,6,7,6,5,5,6,7,6,6,7,
%T A364801 6,5,5,6,7,6,7,6,6,6,6,7,8,7,6,7,8,7,7,8,7,6,7,6,6,7,7,8,7,7,6,7,8,7,
%U A364801 7,8,7,6,7,6,6,7,7,8,7,7,7,8,7,7,7,8,7
%N A364801 The number of iterations that n requires to reach a fixed point under the map x -> A022290(x).
%C A364801 a(n) is well-defined since A022290(n) = n for n <= 3 (the fixed points), and A022290(n) < n for n >= 4.
%H A364801 Amiram Eldar, <a href="/A364801/b364801.txt">Table of n, a(n) for n = 0..10000</a>
%F A364801 a(n) = a(A022290(n)) + 1, for n >= 4.
%e A364801 For n = 4 the trajectory is 4 -> 3. The number of iterations is 1, thus a(4) = 1.
%e A364801 For n = 6 the trajectory is 6 -> 5 -> 4 -> 3. The number of iterations is 3, thus a(6) = 3.
%t A364801 f[n_] := f[n] = Module[{d = IntegerDigits[n, 2], nd}, nd = Length[d]; Total[d * Fibonacci[Range[nd + 1, 2, -1]]]]; (* A022290 *)
%t A364801 a[n_] := -2 + Length@ FixedPointList[f, n]; Array[a, 100, 0]
%o A364801 (PARI) f(n) = {my(b = binary(n), nb = #b); sum(i = 1, nb, b[i] * fibonacci(nb - i + 2)); } \\ A022290
%o A364801 a(n) = if(n < 4, 0, a(f(n)) + 1);
%o A364801 (Python)
%o A364801 def A364801(n):
%o A364801     if n<4: return 0
%o A364801     a, b, s = 1, 2, 0
%o A364801     for i in bin(n)[-1:1:-1]:
%o A364801         if int(i):
%o A364801             s += a
%o A364801         a, b = b, a+b
%o A364801     return A364801(s)+1 # _Chai Wah Wu_, Aug 10 2023
%Y A364801 Cf. A022290.
%Y A364801 Similar sequences: A003434, A364800.
%K A364801 nonn,base,easy
%O A364801 0,6
%A A364801 _Amiram Eldar_, Aug 08 2023