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

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A335472 Number of compositions of n matching the pattern (2,1,2). 8
 0, 0, 0, 0, 0, 1, 3, 9, 25, 66, 165, 394, 914, 2068, 4607, 10093, 21818, 46592, 98498, 206452, 429670, 888818, 1829005, 3746802, 7645511, 15549306, 31534322, 63800562, 128823111, 259678348, 522715526, 1050957282, 2110953835, 4236623798, 8497083721, 17032615177 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,7 COMMENTS Also the number of (1,2,2) or (2,2,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 Andrew Howroyd, Table of n, a(n) for n = 0..200 Wikipedia, Permutation pattern Gus Wiseman, Sequences counting and ranking compositions by the patterns they match or avoid. FORMULA a(n > 0) = 2^(n - 1) - A335473(n). EXAMPLE The a(5) = 1 through a(7) = 9 compositions: (212) (1212) (313) (2112) (2122) (2121) (2212) (11212) (12112) (12121) (21112) (21121) (21211) MATHEMATICA Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], MatchQ[#, {___, x_, ___, y_, ___, x_, ___}/; x>y]&]], {n, 0, 10}] CROSSREFS The version for prime indices is A335453. These compositions are ranked by A335468. The (1,2,1)-matching version is A335470. The complement A335473 is the avoiding version. The version for patterns is A335509. Constant patterns are counted by A000005 and ranked by A272919. Patterns are counted by A000670 and ranked by A333217. Permutations are counted by A000142 and ranked by A333218. 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. Cf. A261982, A034691, A056986, A106356, A238279, A333755. Sequence in context: A295142 A002064 A129589 * A096322 A058396 A006809 Adjacent sequences: A335469 A335470 A335471 * A335473 A335474 A335475 KEYWORD nonn AUTHOR Gus Wiseman, Jun 17 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.

Last modified April 18 16:22 EDT 2024. Contains 371780 sequences. (Running on oeis4.)