login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A335471 Number of compositions of n avoiding the pattern (1,2,1). 8
1, 1, 2, 4, 7, 13, 23, 40, 67, 115, 190, 311, 505, 807, 1285, 2031, 3164, 4896, 7550, 11499, 17480 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

COMMENTS

Also the number of (1,1,2)-avoiding or (2,1,1)-avoiding 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

Table of n, a(n) for n=0..20.

Wikipedia, Permutation pattern

Gus Wiseman, Sequences counting and ranking compositions by the patterns they match or avoid.

FORMULA

a(n > 0) = 2^(n - 1) - A335470(n).

EXAMPLE

The a(0) = 1 through a(5) = 13 compositions:

  ()  (1)  (2)   (3)    (4)     (5)

           (11)  (12)   (13)    (14)

                 (21)   (22)    (23)

                 (111)  (31)    (32)

                        (112)   (41)

                        (211)   (113)

                        (1111)  (122)

                                (212)

                                (221)

                                (311)

                                (1112)

                                (2111)

                                (11111)

MATHEMATICA

Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], !MatchQ[#, {___, x_, ___, y_, ___, x_, ___}/; x<y]&]], {n, 0, 10}]

CROSSREFS

The version for patterns is A001710.

The version for prime indices is A335449.

These compositions are ranked by A335467.

The complement A335470 is the matching version.

The (2,1,2)-avoiding version is A335473.

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.

Compositions avoiding (1,2,3) are counted by A102726.

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.

Cf. A034691, A056986, A106356, A232464, A238279, A333213, A333755.

Sequence in context: A130709 A051013 A128609 * A168043 A114832 A239553

Adjacent sequences:  A335468 A335469 A335470 * A335472 A335473 A335474

KEYWORD

nonn,more

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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 26 09:03 EDT 2020. Contains 338027 sequences. (Running on oeis4.)