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
Christian Sievers, Table of n, a(n) for n = 0..2000
Wikipedia, Permutation pattern
EXAMPLE
The a(0) = 1 through a(4) = 18 pairs of a partition with a matched pattern:
()/() (1)/() (2)/() (3)/() (4)/()
(1)/(1) (2)/(1) (3)/(1) (4)/(1)
(11)/() (21)/() (31)/()
(11)/(1) (21)/(1) (31)/(1)
(11)/(11) (21)/(21) (31)/(21)
(111)/() (22)/()
(111)/(1) (22)/(1)
(111)/(11) (22)/(11)
(111)/(111) (211)/()
(211)/(1)
(211)/(11)
(211)/(21)
(211)/(211)
(1111)/()
(1111)/(1)
(1111)/(11)
(1111)/(111)
(1111)/(1111)
MATHEMATICA
mstype[q_]:=q/.Table[Union[q][[i]]->i, {i, Length[Union[q]]}];
Table[Sum[Length[Union[mstype/@Subsets[y]]], {y, IntegerPartitions[n]}], {n, 0, 8}]
PROG
(PARI)
lista(n) = {
my(v=vector(n+1, i, 1+x*O(x^n)));
for(k=1, n,
v=vector(n\(k+1)+1, i,
(1-x^(i*k))/(1-x^k)*v[i] + sum(j=i, n\k, x^(j*k)*v[j+1]) +
x^(k*i)/(1-x^k)^2*v[1] ) );
Vec(v[1]) } \\ Christian Sievers, May 08 2025
CROSSREFS
The version for compositions in standard order is A335454.
The version for compositions is A335456.
The version for Heinz numbers of partitions is A335549.
The contiguous case is A335838.
Patterns contiguously matched by prime indices are A335516.
Contiguous divisors are counted by A335519.
Minimal patterns avoided by prime indices are counted by A335550.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jun 27 2020
EXTENSIONS
a(18) corrected by and a(19)-a(22) from Jinyuan Wang, Jun 27 2020
More terms from Christian Sievers, May 08 2025
STATUS
approved
