A335517 Number of matching pairs of patterns, the longest having length n.
1, 2, 9, 64, 623, 7866, 122967
Offset: 0
Examples
The a(0) = 1 through a(2) = 9 pairs of patterns: ()<=() ()<=(1) ()<=(1,1) (1)<=(1) ()<=(1,2) ()<=(2,1) (1)<=(1,1) (1)<=(1,2) (1)<=(2,1) (1,1)<=(1,1) (1,2)<=(1,2) (2,1)<=(2,1)
Links
- Wikipedia, Permutation pattern
- Gus Wiseman, Sequences counting and ranking compositions by the patterns they match or avoid.
Crossrefs
Programs
-
Mathematica
mstype[q_]:=q/.Table[Union[q][[i]]->i,{i,Length[Union[q]]}]; allnorm[n_]:=If[n<=0,{{}},Function[s,Array[Count[s,y_/;y<=#]+1&,n]]/@Subsets[Range[n-1]+1]]; Table[Sum[Length[Union[mstype/@Subsets[y]]],{y,Join@@Permutations/@allnorm[n]}],{n,0,5}]
Comments