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.

Showing 1-2 of 2 results.

A364800 The number of iterations that n requires to reach 1 under the map x -> A356874(x).

Original entry on oeis.org

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

Views

Author

Amiram Eldar, Aug 08 2023

Keywords

Comments

a(n) is well-defined since A356874(1) = 1, and A356874(n) < n for n >= 2.

Examples

			For n = 3 the trajectory is 3 -> 2 -> 1. The number of iterations is 2, thus a(3) = 2.
		

Crossrefs

Cf. A356874.
Similar sequences: A003434, A364801.

Programs

  • 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]
  • 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);

Formula

a(n) = a(A356874(n)) + 1, for n >= 2.

A364803 Smallest number that reaches a fixed point after n iterations of the map x -> A022290(x).

Original entry on oeis.org

0, 4, 5, 6, 7, 10, 14, 23, 46, 117, 442, 3006, 47983, 2839934, 918486751, 3769839124330
Offset: 0

Views

Author

Amiram Eldar, Aug 08 2023

Keywords

Comments

a(n) is the smallest number k such that A364801(k) = n.

Crossrefs

Similar sequences: A007755, A364802.

Programs

  • Mathematica
    f[n_] := f[n] = Module[{d = IntegerDigits[n, 2], nd}, nd = Length[d]; Total[d * Fibonacci[Range[nd + 1, 2, -1]]]]; (* A022290 *)
    iternum[n_] := -2 + Length@ FixedPointList[f, n]; (* A364801 *)
    seq[kmax_] := Module[{s = {}, imax = -1, i}, Do[i = iternum[k]; If[i > imax, imax = i; AppendTo[s, k]], {k, 0, kmax}]; s]
    seq[10^6]
  • PARI
    f(n) = {my(b = binary(n), nb = #b); sum(i = 1, nb, b[i] * fibonacci(nb - i + 2)); } \\ A022290
    iternum(n) = if(n < 4, 0, iternum(f(n)) + 1); \\ A364801
    lista(kmax) = {my(imax = -1, i1); for(k = 0, kmax, i = iternum(k); if(i > imax, imax = i; print1(k, ", ")));}

Extensions

a(15) from Martin Ehrenstein, Aug 25 2023
Showing 1-2 of 2 results.