A214614 Irregular triangle read by rows: row n gives numbers <= n whose Collatz trajectory contains the trajectory of n.
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
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}
Links
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 *)
Comments