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.

A337150 Nonnegative integers in the order in which they appear first in A006577.

Original entry on oeis.org

0, 1, 7, 2, 5, 8, 16, 3, 19, 6, 14, 9, 17, 4, 12, 20, 15, 10, 23, 111, 18, 106, 26, 13, 21, 34, 109, 29, 104, 11, 24, 112, 32, 107, 27, 102, 22, 115, 35, 110, 30, 92, 105, 118, 25, 87, 38, 100, 113, 69, 33, 95, 46, 108, 121, 28, 41, 90, 103, 116, 36, 85, 54
Offset: 1

Views

Author

Alois P. Heinz, Jan 27 2021

Keywords

Comments

This is A006577 with duplicates removed.
This is a permutation of the nonnegative integers.

Crossrefs

Programs

  • Maple
    collatz:= proc(n) option remember; `if`(n=1, 0,
       1 + collatz(`if`(n::even, n/2, 3*n+1)))
    end:
    b:= proc() 0 end:
    g:= proc(n) option remember; local t;
         `if`(n=1, 0, g(n-1));
          t:= collatz(n); b(t):= b(t)+1
        end:
    h:= proc(n) option remember; local k; for k
          from 1+h(n-1) while g(k)>1 do od; k
        end: h(0):=0:
    a:= n-> collatz(h(n)):
    seq(a(n), n=1..100);
  • Mathematica
    collatz[n_] := collatz[n] = If[n==1, 0,
       1 + collatz[If[EvenQ[n], n/2, 3n+1]]];
    b[_] = 0;
    g[n_] := g[n] = Module[{t}, If[n==1, 0, g[n-1]];
       t = collatz[n]; b[t] = b[t]+1];
    h[n_] := h[n] = Module[{k}, For[k = 1+h[n-1],
       g[k]>1, k++]; k]; h[0] = 0;
    a[n_] := a[n] = collatz[h[n]];
    Array[a, 100] (* Jean-François Alcover, Jan 30 2021, after Alois P. Heinz *)

Formula

a(n) = A006577(A337149(n)).
a(n) = A006577(n) for 1 <= n <= 12.
Showing 1-1 of 1 results.