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.

A332834 Number of compositions of n that are neither weakly increasing nor weakly decreasing.

Original entry on oeis.org

0, 0, 0, 0, 1, 4, 14, 36, 88, 199, 432, 914, 1900, 3896, 7926, 16036, 32311, 64944, 130308, 261166, 523040, 1046996, 2095152, 4191796, 8385466, 16773303, 33549564, 67102848, 134210298, 268426328, 536859712, 1073728142, 2147466956, 4294947014, 8589909976
Offset: 0

Views

Author

Gus Wiseman, Feb 29 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.

Examples

			The a(4) = 1 through a(6) = 14 compositions:
  (121)  (131)   (132)
         (212)   (141)
         (1121)  (213)
         (1211)  (231)
                 (312)
                 (1131)
                 (1212)
                 (1221)
                 (1311)
                 (2112)
                 (2121)
                 (11121)
                 (11211)
                 (12111)
		

Crossrefs

The version for unsorted prime signature is A332831.
The version for run-lengths of compositions is A332833.
The complement appears to be counted by A329398.
Unimodal compositions are A001523.
Compositions that are not unimodal are A115981.
Partitions with weakly increasing or decreasing run-lengths are A332745.
Compositions with weakly increasing or decreasing run-lengths are A332835.
Compositions with weakly increasing run-lengths are A332836.
Compositions that are neither unimodal nor is their negation are A332870.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!Or[LessEqual@@#,GreaterEqual@@#]&]],{n,0,10}]
  • PARI
    a(n)={if(n==0, 0, 2^(n-1) - 2*numbpart(n) + numdiv(n))} \\ Andrew Howroyd, Dec 30 2020

Formula

a(n) = 2^(n - 1) - 2 * A000041(n) + A000005(n).