cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A335457 Number of normal patterns contiguously matched by compositions of n.

Original entry on oeis.org

1, 2, 5, 12, 31, 80, 196, 486, 1171, 2787, 6564, 15323, 35403, 81251, 185087, 418918, 942525, 2109143, 4695648, 10405694, 22959156
Offset: 0

Views

Author

Gus Wiseman, Jun 23 2020

Keywords

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).

Examples

			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)
		

Crossrefs

The version for standard compositions is A335458.
The non-contiguous version is A335456.
Patterns are counted by A000670 and ranked by A333217.
The n-th standard composition has A124771(n) contiguous subsequences.
Patterns contiguously matched by prime indices are A335549.
Minimal avoided patterns of prime indices are counted by A335550.

Programs

  • 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}]

Extensions

a(16)-a(20) from Jinyuan Wang, Jul 08 2020