A338169 A list of all finite sequences of distinct positive integers sorted by their maximum value, then lexicographically.
1, 1, 2, 2, 2, 1, 1, 2, 3, 1, 3, 1, 3, 2, 2, 1, 3, 2, 3, 2, 3, 1, 3, 3, 1, 3, 1, 2, 3, 2, 3, 2, 1, 1, 2, 3, 4, 1, 2, 4, 1, 2, 4, 3, 1, 3, 2, 4, 1, 3, 4, 1, 3, 4, 2, 1, 4, 1, 4, 2, 1, 4, 2, 3, 1, 4, 3, 1, 4, 3, 2, 2, 1, 3, 4, 2, 1, 4, 2, 1, 4, 3, 2, 3, 1, 4, 2
Offset: 1
Examples
Maximum value 1: [1], Maximum value 2: [1,2], [2], [2,1], Maximum value 3: [1,2,3], [1,3], [1,3,2], [2,1,3], [2,3], [2,3,1], [3], [3,1], [3,1,2], [3,2], [3,2,1]
Links
- Peter Kagey, Table of n, a(n) for n = 1..9786 (all sequences with maximum <= 6.)
Programs
-
Mathematica
Table[Map[ToExpression /@ StringPartition[#, 1, 1] &, Sort[Map[StringJoin, Join @@ Map[Permutations, DeleteCases[Rest@ Subsets[ToString /@ Range@ k], ?(FreeQ[#, ToString@ k] &)]]]]], {k, 4}] // Flatten (* _Michael De Vlieger, Oct 15 2020 *)
Comments