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.

A380244 The Collatz (or 3x+1) trajectory starting at a(n) contains exactly n odd integers and a(n) is the n-th number with this property.

Original entry on oeis.org

1, 10, 12, 68, 45, 30, 72, 101, 134, 179, 237, 314, 422, 551, 723, 509, 1282, 887, 1170, 1535, 2021, 1509, 1899, 2412, 1780, 2217, 3170, 3867, 2819, 3728, 2511, 3155, 3972, 2802, 3578, 2623, 3444, 4302, 3087, 3968, 2690, 1806, 2336, 1593, 2084, 2757, 1884, 2477
Offset: 1

Views

Author

Alois P. Heinz, Jan 17 2025

Keywords

Examples

			a(2) = 10 is the second integer (after 5) having exactly two odd integers in the Collatz trajectory: 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1.
		

Crossrefs

Main diagonal of A354236.

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)) A(n$2):
    seq(a(n), n=1..48);

Formula

A078719(a(n)) = n.

A337149 Positive integers k such that the number of steps it takes to reach 1 in the '3x+1' problem is different for all j < k.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 16, 17, 18, 22, 24, 25, 27, 28, 31, 33, 34, 36, 39, 41, 43, 47, 48, 49, 54, 57, 62, 65, 71, 72, 73, 78, 82, 86, 91, 94, 97, 98, 103, 105, 107, 108, 111, 114, 121, 123, 124, 129, 130, 135, 137, 142, 145, 153, 155, 159
Offset: 1

Views

Author

Alois P. Heinz, Jan 27 2021

Keywords

Comments

Positive integers k such that A337144(k) = 1.
Or positive integers k such that A006577(k) != A006577(j) for all j = 1..k-1.
Different from A129304.

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:
    a:= proc(n) option remember; local k; for k
          from 1+a(n-1) while g(k)>1 do od; k
        end: a(0):=0:
    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];
    a[n_] := a[n] = Module[{k}, For[k = 1+a[n-1],
       g[k] > 1, k++]; k]; a[0] = 0;
    Array[a, 100] (* Jean-François Alcover, Jan 30 2021, after Alois P. Heinz *)

Formula

A006577(a(n)) = A337150(n).
Showing 1-2 of 2 results.