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-1 of 1 results.

A368878 a(n) is the least k such that A368877^k(n) < n or -1 if no such k exists.

Original entry on oeis.org

2, 1, 1, 2, 3, 1, 2, 1, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, 1, 1, 2, 8, 1, 2, 1, 1, 1, 1, 1, 2, 1, 8, 1, 2, 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 7, 7, 1, 2, 1, 2, 2, 2, 8, 8, 1, 1, 1, 1, 1, 1, 1, 6, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 7, 7, 1, 1, 1, 1, 1, 1, 1, 6, 1
Offset: 3

Views

Author

Michel Marcus, Jan 08 2024

Keywords

Comments

This is the falling time function ft in the paper of Eliahou et al.
The offset is 3 because A368877(1) = A368877(2) = 2, so for n<3 is not defined.

Crossrefs

Programs

  • Mathematica
    A368877[n_] := Nest[If[OddQ[#], (3*#+1)/2, #/2] &, n, BitLength[n]];
    A368878[n_] := Length[NestWhileList[A368877, n, #>=n&]]-1;
    Array[A368878, 120, 3] (* Paolo Xausa, Jan 08 2024 *)
  • PARI
    T(n) = if (n%2, (3*n+1)/2, n/2); \\ A014682
    jp(n) = my(N=1+logint(n, 2)); for (i=1, N, n = T(n)); n; \\ A368877
    a(n) = my(k=1, m=n); while ((m=jp(m)) >= n, k++); k;
Showing 1-1 of 1 results.