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.

A220237 Triangle read by rows: sorted terms of Collatz trajectories.

Original entry on oeis.org

1, 1, 2, 1, 2, 3, 4, 5, 8, 10, 16, 1, 2, 4, 1, 2, 4, 5, 8, 16, 1, 2, 3, 4, 5, 6, 8, 10, 16, 1, 2, 4, 5, 7, 8, 10, 11, 13, 16, 17, 20, 22, 26, 34, 40, 52, 1, 2, 4, 8, 1, 2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 16, 17, 20, 22, 26, 28, 34, 40, 52, 1, 2, 4, 5, 8, 10, 16
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 03 2013

Keywords

Comments

n-th row = sorted list of {A070165(n,k): k = 1..A006577(n)};
T(n,1) = 1 if Collatz conjecture is true.

Examples

			The table begins:
.   1:  [1]
.   2:  [1,2]
.   3:  [1,2,3,4,5,8,10,16]
.   4:  [1,2,4]
.   5:  [1,2,4,5,8,16]
.   6:  [1,2,3,4,5,6,8,10,16]
.   7:  [1,2,4,5,7,8,10,11,13,16,17,20,22,26,34,40,52]
.   8:  [1,2,4,8]
.   9:  [1,2,4,5,7,8,9,10,11,13,14,16,17,20,22,26,28,34,40,52]
.  10:  [1,2,4,5,8,10,16]
.  11:  [1,2,4,5,8,10,11,13,16,17,20,26,34,40,52]
.  12:  [1,2,3,4,5,6,8,10,12,16] .
		

Crossrefs

Cf. A006577 (row lengths), A025586(right edge), A033493 (row sums).

Programs

  • Haskell
    import Data.List (sort)
    a220237 n k = a220237_tabf !! (n-1) !! (k-1)
    a220237_row n = a220237_tabf !! (n-1)
    a220237_tabf = map sort a070165_tabf
  • Maple
    T:= proc(n) option remember; `if`(n=1, 1,
          sort([n, T(`if`(n::even, n/2, 3*n+1))])[])
        end:
    seq(T(n), n=1..10);  # Alois P. Heinz, Oct 16 2021
  • Mathematica
    Flatten[Table[Sort[NestWhileList[If[EvenQ[#],#/2,3#+1]&,n,#>1&]],{n,12}]] (* Harvey P. Dale, Jan 28 2013 *)