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.

A354236 A(n,k) is the n-th number m such that the Collatz (or 3x+1) trajectory starting at m contains exactly k odd integers; square array A(n,k), n>=1, k>=1, read by antidiagonals.

Original entry on oeis.org

1, 5, 2, 3, 10, 4, 17, 6, 20, 8, 11, 34, 12, 21, 16, 7, 22, 35, 13, 40, 32, 9, 14, 23, 68, 24, 42, 64, 25, 18, 15, 44, 69, 26, 80, 128, 33, 49, 19, 28, 45, 70, 48, 84, 256, 43, 65, 50, 36, 29, 46, 75, 52, 85, 512, 57, 86, 66, 51, 37, 30, 88, 136, 53, 160, 1024
Offset: 1

Views

Author

Alois P. Heinz, May 20 2022

Keywords

Examples

			Square array A(n,k) begins:
    1,   5,  3,  17, 11,  7,  9,  25,  33,  43, ...
    2,  10,  6,  34, 22, 14, 18,  49,  65,  86, ...
    4,  20, 12,  35, 23, 15, 19,  50,  66,  87, ...
    8,  21, 13,  68, 44, 28, 36,  51,  67,  89, ...
   16,  40, 24,  69, 45, 29, 37,  98, 130, 172, ...
   32,  42, 26,  70, 46, 30, 38,  99, 131, 173, ...
   64,  80, 48,  75, 88, 56, 72, 100, 132, 174, ...
  128,  84, 52, 136, 90, 58, 74, 101, 133, 177, ...
  256,  85, 53, 138, 92, 60, 76, 102, 134, 178, ...
  512, 160, 96, 140, 93, 61, 77, 196, 260, 179, ...
		

Crossrefs

Row n=1 gives A092893(k-1).
Main diagonal gives A380244.

Programs

  • Maple
    b:= proc(n) option remember; irem(n, 2, 'r')+
          `if`(n=1, 0, b(`if`(n::odd, 3*n+1, r)))
        end:
    A:= proc() local h, p, q; p, q:= proc() [] end, 0;
          proc(n, k)
            if k=1 then return 2^(n-1) fi;
            while nops(p(k))
    				
  • Mathematica
    b[n_] := b[n] = Module[{q, r}, {q, r} = QuotientRemainder[n, 2]; r +
         If[n == 1, 0, b[If[OddQ[n], 3*n + 1, q]]]];
    A = Module[{h, p, q}, p[_] = {}; q = 0;
         Function[{n, k}, If[k == 1, 2^(n - 1)];
         While[Length[p[k]] < n, q = q + 1;
            h = b[q];
            p[h] = Append[p[h], q]];
         p[k][[n]]]];
    Table[Table[A[n, 1+d-n], {n, 1, d}], {d, 1, 12}] // Flatten (* Jean-François Alcover, Jun 02 2022, after Alois P. Heinz *)

Formula

A078719(A(n,k)) = k.

A337144 n is the a(n)-th positive integer which takes its number of steps to reach 1 in the Collatz (or 3x+1) problem.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 2, 3, 1, 2, 1, 1, 2, 1, 1, 2, 3, 1, 2, 1, 1, 2, 1, 2, 3, 1, 2, 1, 3, 1, 2, 3, 4, 1, 1, 1, 2, 3, 2, 3, 1, 2, 2, 1, 3, 2, 4, 5, 1, 2, 2, 1, 2, 3, 2, 3, 4, 1, 1, 1, 2, 5, 3, 4, 1, 2, 3, 5, 1, 2, 4, 5, 1, 2
Offset: 1

Views

Author

Alois P. Heinz, Jan 27 2021

Keywords

Examples

			a(13) = 2 because A006577(13) = A006577(12) = 9 != A006577(j) for j < 12.
		

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:
    a:= proc(n) option remember; local t;
         `if`(n=1, 0, a(n-1));
          t:= collatz(n); b(t):= b(t)+1
        end:
    seq(a(n), n=1..120);
  • Mathematica
    collatz[n_] := collatz[n] = If[n == 1, 0,
       1 + collatz[If[EvenQ[n], n/2, 3n+1]]];
    b[_] = 0;
    a[n_] := a[n] = Module[{t},
       If[n == 1, 0, a[n-1]];
       t = collatz[n]; b[t] = b[t]+1];
    Array[a, 120] (* Jean-François Alcover, Jan 29 2021, after Alois P. Heinz *)

Formula

Ordinal transform of A006577.
a(n) = |{ j in {1..n} : A006577(j) = A006577(n) }|.
Showing 1-2 of 2 results.