A248141 Table read by rows: n-th row contains all subsets of consecutive numbers of 1..n.
1, 1, 2, 1, 2, 1, 2, 3, 1, 2, 2, 3, 1, 2, 3, 1, 2, 3, 4, 1, 2, 2, 3, 3, 4, 1, 2, 3, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 5, 1, 2, 2, 3, 3, 4, 4, 5, 1, 2, 3, 2, 3, 4, 3, 4, 5, 1, 2, 3, 4, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6
Offset: 1
Examples
. 1: 1 . 2: 1,2,1,2 . 3: 1,2,3,1,2,2,3,1,2,3 . 4: 1,2,3,4,1,2,2,3,3,4,1,2,3,2,3,4,1,2,3,4 . 5: 1,2,3,4,5,1,2,2,3,3,4,4,5,1,2,3,2,3,4,3,4,5,1,2,3,4,2,3,4,5,1,2,3,4,5 rows concatenated from: . 1: [1] . 2: [1] [2] [1,2] . 3: [1] [2] [3] [1,2] [2,3] [1,2,3] . 4: [1] [2] [3] [4] [1,2] [2,3] [3,4] [1,2,3] [2,3,4] [1,2,3,4] . 5: [1] [2] [3] [4] [5] [1,2] [2,3] [3,4] [4,5] [1,2,3] [2,3,4] ...
Links
- Reinhard Zumkeller, Rows n = 1..20 of triangle, flattened
Programs
-
Haskell
import Data.List (group) a248141 n k = a248141_tabf !! (n-1) !! (k-1) a248141_row n = a248141_tabf !! (n-1) a248141_tabf = map concat usss where usss = iterate f [[1]] where f vss = group [1 .. last (last vss) + 1] ++ map (\ws -> ws ++ [last ws + 1]) vss
-
Mathematica
Flatten[Table[Flatten[Table[Partition[Range[n],i,1],{i,n}]],{n,6}]] (* Harvey P. Dale, Feb 03 2015 *)
Comments