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.

A214614 Irregular triangle read by rows: row n gives numbers <= n whose Collatz trajectory contains the trajectory of n.

Original entry on oeis.org

1, 1, 2, 1, 2, 3, 1, 2, 4, 1, 2, 4, 5, 1, 2, 3, 4, 5, 6, 1, 2, 4, 5, 7, 1, 2, 4, 8, 1, 2, 4, 5, 7, 8, 9, 1, 2, 4, 5, 8, 10, 1, 2, 4, 5, 8, 10, 11, 1, 2, 3, 4, 5, 6, 8, 10, 12, 1, 2, 4, 5, 8, 10, 13, 1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 1, 2, 4, 5, 8, 10, 15
Offset: 1

Views

Author

Jayanta Basu, Mar 06 2013

Keywords

Comments

Each row has A159999(n) elements and ends in n.

Examples

			Rows of triangle:
{1},
{1, 2},
{1, 2, 3},
{1, 2, 4},
{1, 2, 4, 5},
{1, 2, 3, 4, 5, 6},
{1, 2, 4, 5, 7},
{1, 2, 4, 8},
{1, 2, 4, 5, 7, 8, 9},
{1, 2, 4, 5, 8, 10}
		

Crossrefs

Programs

  • Haskell
    import Data.List (sort)
    a214614 n k = a214614_tabf !! (n-1) (k-1)
    a214614_row n = a214614_tabf !! (n-1)
    a214614_tabf = zipWith f [1..] a070165_tabf where
                           f v ws = sort $ filter (<= v) ws
    -- Reinhard Zumkeller, Sep 01 2014
  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; f[n_] := Module[{c = Collatz[n]}, Select[c, # <= n &]]; t = Table[f[n], {n, 20}]; Flatten[t] (* T. D. Noe, Mar 07 2013 *)