OFFSET
0,2
COMMENTS
We define a (normal) pattern to be a finite sequence covering an initial interval of positive integers. Patterns are counted by A000670 and ranked by A333217. A sequence S is said to match a pattern P if there is a not necessarily contiguous subsequence of S whose parts have the same relative order as P. For example, (3,1,1,3) matches (1,1,2), (2,1,1), and (2,1,2), but avoids (1,2,1), (1,2,2), and (2,2,1).
LINKS
EXAMPLE
The a(0) = 1 through a(3) = 12 pairs of a composition with a contiguously matched pattern:
()() (1)() (2)() (3)()
(1)(1) (11)() (12)()
(2)(1) (21)()
(11)(1) (3)(1)
(11)(11) (111)()
(12)(1)
(21)(1)
(111)(1)
(12)(12)
(21)(21)
(111)(11)
(111)(111)
MATHEMATICA
mstype[q_]:=q/.Table[Union[q][[i]]->i, {i, Length[Union[q]]}];
Table[Sum[Length[Union[mstype/@ReplaceList[cmp, {___, s___, ___}:>{s}]]], {cmp, Join@@Permutations/@IntegerPartitions[n]}], {n, 0, 10}]
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Gus Wiseman, Jun 23 2020
EXTENSIONS
a(16)-a(20) from Jinyuan Wang, Jul 08 2020
STATUS
approved