OFFSET
1,3
COMMENTS
LINKS
Reinhard Zumkeller, Rows n = 1..20 of triangle, flattened
EXAMPLE
. 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] ...
MATHEMATICA
Flatten[Table[Flatten[Table[Partition[Range[n], i, 1], {i, n}]], {n, 6}]] (* Harvey P. Dale, Feb 03 2015 *)
PROG
(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
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Reinhard Zumkeller, Oct 02 2014
STATUS
approved