login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A335470 Number of compositions of n matching the pattern (1,2,1). 10
0, 0, 0, 0, 1, 3, 9, 24, 61, 141, 322, 713, 1543, 3289, 6907, 14353, 29604, 60640, 123522, 250645, 506808, 1022197, 2057594, 4135358, 8301139, 16648165, 33364948, 66831721, 133814251, 267850803, 536026676, 1072528081, 2145745276, 4292485526, 8586405894, 17174865820 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,6
COMMENTS
Also the number of (1,1,2)-matching or (2,1,1)-matching compositions.
We define a 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).
A composition of n is a finite sequence of positive integers summing to n.
LINKS
FORMULA
a(n > 0) = 2^(n - 1) - A335471(n).
EXAMPLE
The a(4) = 1 through a(6) = 9 compositions:
(121) (131) (141)
(1121) (1131)
(1211) (1212)
(1221)
(1311)
(2121)
(11121)
(11211)
(12111)
MATHEMATICA
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], MatchQ[#, {___, x_, ___, y_, ___, x_, ___}/; x<y]&]], {n, 0, 10}]
CROSSREFS
The version for prime indices is A335446.
These compositions are ranked by A335466.
The complement A335471 is the avoiding version.
The (2,1,2)-matching version is A335472.
The version for patterns is A335509.
Constant patterns are counted by A000005 and ranked by A272919.
Permutations are counted by A000142 and ranked by A333218.
Patterns are counted by A000670 and ranked by A333217.
Compositions are counted by A011782.
Non-unimodal compositions are counted by A115981 and ranked by A335373.
Combinatory separations are counted by A269134.
Patterns matched by compositions are counted by A335456.
Minimal patterns avoided by a standard composition are counted by A335465.
Compositions matching (1,2,3) are counted by A335514.
Sequence in context: A320731 A084858 A228820 * A003262 A189162 A079282
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jun 17 2020
EXTENSIONS
Terms a(21) and beyond from Andrew Howroyd, Dec 31 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 00:26 EDT 2024. Contains 371264 sequences. (Running on oeis4.)