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!)
A337481 Number of compositions of n that are neither strictly increasing nor strictly decreasing. 5
0, 0, 1, 1, 5, 11, 25, 55, 117, 241, 493, 1001, 2019, 4061, 8149, 16331, 32705, 65461, 130981, 262037, 524161, 1048425, 2096975, 4194097, 8388365, 16776933, 33554103, 67108481, 134217285, 268434945, 536870321, 1073741145, 2147482869, 4294966401, 8589933569 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,5
COMMENTS
A composition of n is a finite sequence of positive integers summing to n.
LINKS
FORMULA
a(n) = 2^(n-1) - 2*A000009(n) + 1, n > 0.
EXAMPLE
The a(2) = 1 through a(5) = 11 compositions:
(11) (111) (22) (113)
(112) (122)
(121) (131)
(211) (212)
(1111) (221)
(311)
(1112)
(1121)
(1211)
(2111)
(11111)
MATHEMATICA
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], !Less@@#&&!Greater@@#&]], {n, 0, 15}]
CROSSREFS
Ranked by the complement of the intersection of A333255 and A333256.
A332834 is the weak version.
A337482 is the semi-strict version.
A337484 counts only compositions of length 3.
A007318 and A097805 count compositions by length.
A032020 counts strict compositions, ranked by A233564.
A218004 counts strictly increasing or weakly decreasing compositions.
Sequence in context: A296911 A167238 A084640 * A056739 A003598 A014858
KEYWORD
nonn
AUTHOR
Gus Wiseman, Sep 11 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 May 12 03:46 EDT 2024. Contains 372431 sequences. (Running on oeis4.)