login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A248141 Table read by rows: n-th row contains all subsets of consecutive numbers of 1..n. 3

%I #12 Feb 03 2015 17:16:47

%S 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,

%T 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,

%U 4,5,1,2,3,4,5,6,1,2,2,3,3,4,4,5,5,6

%N Table read by rows: n-th row contains all subsets of consecutive numbers of 1..n.

%C A000292(n) = length of n-th row, whereas A000217(n) = number of all consecutive subsets of numbers 1..n;

%C A248147(n,k) = A000040(T(n,k)), 1 <= k <= A000292(n).

%H Reinhard Zumkeller, <a href="/A248141/b248141.txt">Rows n = 1..20 of triangle, flattened</a>

%e . 1: 1

%e . 2: 1,2,1,2

%e . 3: 1,2,3,1,2,2,3,1,2,3

%e . 4: 1,2,3,4,1,2,2,3,3,4,1,2,3,2,3,4,1,2,3,4

%e . 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

%e rows concatenated from:

%e . 1: [1]

%e . 2: [1] [2] [1,2]

%e . 3: [1] [2] [3] [1,2] [2,3] [1,2,3]

%e . 4: [1] [2] [3] [4] [1,2] [2,3] [3,4] [1,2,3] [2,3,4] [1,2,3,4]

%e . 5: [1] [2] [3] [4] [5] [1,2] [2,3] [3,4] [4,5] [1,2,3] [2,3,4] ...

%t Flatten[Table[Flatten[Table[Partition[Range[n],i,1],{i,n}]],{n,6}]] (* _Harvey P. Dale_, Feb 03 2015 *)

%o (Haskell)

%o import Data.List (group)

%o a248141 n k = a248141_tabf !! (n-1) !! (k-1)

%o a248141_row n = a248141_tabf !! (n-1)

%o a248141_tabf = map concat usss where

%o usss = iterate f [[1]] where

%o f vss = group [1 .. last (last vss) + 1] ++

%o map (\ws -> ws ++ [last ws + 1]) vss

%Y Cf. A000292 (row lengths), A000217, A248147.

%K nonn,tabf

%O 1,3

%A _Reinhard Zumkeller_, Oct 02 2014

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 16:42 EDT 2024. Contains 371989 sequences. (Running on oeis4.)