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.

Showing 1-3 of 3 results.

A349054 Number of alternating strict compositions of n. Number of alternating (up/down or down/up) permutations of strict integer partitions of n.

Original entry on oeis.org

1, 1, 1, 3, 3, 5, 9, 11, 15, 21, 35, 41, 59, 75, 103, 155, 193, 255, 339, 443, 569, 841, 1019, 1365, 1743, 2295, 2879, 3785, 5151, 6417, 8301, 10625, 13567, 17229, 21937, 27509, 37145, 45425, 58345, 73071, 93409, 115797, 147391, 182151, 229553, 297061, 365625
Offset: 0

Views

Author

Gus Wiseman, Dec 21 2021

Keywords

Comments

A strict composition of n is a finite sequence of distinct positive integers summing to n.
A sequence is alternating if it is alternately strictly increasing and strictly decreasing, starting with either.
The case starting with an increase (or decrease, it doesn't matter in the enumeration) is counted by A129838.

Examples

			The a(1) = 1 through a(7) = 11 compositions:
  (1)  (2)  (3)    (4)    (5)    (6)      (7)
            (1,2)  (1,3)  (1,4)  (1,5)    (1,6)
            (2,1)  (3,1)  (2,3)  (2,4)    (2,5)
                          (3,2)  (4,2)    (3,4)
                          (4,1)  (5,1)    (4,3)
                                 (1,3,2)  (5,2)
                                 (2,1,3)  (6,1)
                                 (2,3,1)  (1,4,2)
                                 (3,1,2)  (2,1,4)
                                          (2,4,1)
                                          (4,1,2)
		

Crossrefs

Ranking sequences are put in parentheses below.
This is the strict case of A025047/A025048/A025049 (A345167).
This is the alternating case of A032020 (A233564).
The unordered case (partitions) is A065033.
The directed case is A129838.
A001250 = alternating permutations (A349051), complement A348615 (A350250).
A003242 = Carlitz (anti-run) compositions, complement A261983.
A011782 = compositions, unordered A000041.
A345165 = partitions without an alternating permutation (A345171).
A345170 = partitions with an alternating permutation (A345172).
A345192 = non-alternating compositions (A345168).
A345195 = non-alternating anti-run compositions (A345169).
A349800 = weakly but not strongly alternating compositions (A349799).
A349052 = weakly alternating compositions, complement A349053 (A349057).

Programs

  • Maple
    g:= proc(u, o) option remember;
          `if`(u+o=0, 1, add(g(o-1+j, u-j), j=1..u))
        end:
    b:= proc(n, k) option remember; `if`(k<0 or n<0, 0,
          `if`(k=0, `if`(n=0, 2, 0), b(n-k, k)+b(n-k, k-1)))
        end:
    a:= n-> add(b(n, k)*g(k, 0), k=0..floor((sqrt(8*n+1)-1)/2))-1:
    seq(a(n), n=0..46);  # Alois P. Heinz, Dec 22 2021
  • Mathematica
    wigQ[y_]:=Or[Length[y]==0,Length[Split[y]]==Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1];
    Table[Length[Select[Join@@Permutations/@Select[IntegerPartitions[n],UnsameQ@@#&],wigQ]],{n,0,15}]

Formula

a(n) = 2 * A129838(n) - 1.
G.f.: Sum_{n>0} A001250(n)*x^(n*(n+1)/2)/Product_{k=1..n}(1-x^k).

A058884 Partial sums of the partition function (A000041), with the last term subtracted. Also the sum of the row of the character table for S_n corresponding to the partition n-1,1 for n>1. Also the sum over all partitions lambda of n of one less than the number of 1's in lambda.

Original entry on oeis.org

-1, 0, 0, 1, 2, 5, 8, 15, 23, 37, 55, 83, 118, 171, 238, 332, 453, 618, 827, 1107, 1460, 1922, 2504, 3253, 4188, 5380, 6860, 8722, 11024, 13895, 17421, 21787, 27122, 33677, 41653, 51390, 63179, 77496, 94755, 115600, 140632, 170725, 206717, 249804, 301151, 362367, 435077, 521439, 623674, 744695
Offset: 0

Views

Author

Edward Early, Jan 08 2001

Keywords

Comments

For n>=1 number of up-steps in all partitions of n (represented as weakly increasing lists), see example. - Joerg Arndt, Sep 03 2014

Examples

			a(6) = 8 because the 11 partitions of 6
01:  [ 1 1 1 1 1 1 ]
02:  [ 1 1 1 1 2 ]
03:  [ 1 1 1 3 ]
04:  [ 1 1 2 2 ]
05:  [ 1 1 4 ]
06:  [ 1 2 3 ]
07:  [ 1 5 ]
08:  [ 2 2 2 ]
09:  [ 2 4 ]
10:  [ 3 3 ]
11:  [ 6 ]
contain 0+1+1+1+1+2+1+0+1+0+0 = 8 up-steps. - _Joerg Arndt_, Sep 03 2014
		

Crossrefs

Cf. A218074 (up-steps in partitions into distinct parts).

Programs

  • Maple
    a:= proc(n) uses combinat; add(numbpart(k), k=0..n-1)-numbpart(n) end:
    seq(a(n), n=0..49);
  • Mathematica
    p[n_] := IntegerPartitions[n]; l[n_] := Length[p[n]]; Table[Count[Flatten[p[n]], 1] - l[n], {n, 0, 30}] (* Clark Kimberling, Mar 08 2012 *)
  • PARI
    a(n) = {sum(k=0, n-1, numbpart(k)) - numbpart(n)} \\ Andrew Howroyd, Apr 21 2023
    
  • PARI
    Vec((2*x - 1)/(1 - x)/eta(x + O(x^51))) \\ Andrew Howroyd, Apr 21 2023

Formula

From Andrew Howroyd, Apr 21 2023: (Start)
a(n) = A000070(n-1) - A000041(n) for n > 0.
G.f.: (2*x - 1)*P(x)/(1 - x) where P(x) is the g.f. of A000041. (End)

Extensions

More terms from James Sellers, Sep 28 2001

A129838 Number of up/down (or down/up) compositions of n into distinct parts.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 5, 6, 8, 11, 18, 21, 30, 38, 52, 78, 97, 128, 170, 222, 285, 421, 510, 683, 872, 1148, 1440, 1893, 2576, 3209, 4151, 5313, 6784, 8615, 10969, 13755, 18573, 22713, 29173, 36536, 46705, 57899, 73696, 91076, 114777, 148531, 182813, 228938, 287042
Offset: 0

Views

Author

Vladeta Jovovic, May 21 2007

Keywords

Comments

Original name was: Number of alternating compositions of n into distinct parts.
A composition is up/down if it is alternately strictly increasing and strictly decreasing, starting with an increase. - Gus Wiseman, Jan 15 2022

Examples

			From _Gus Wiseman_, Jan 15 2022: (Start)
The a(1) = 1 through a(8) = 8 up/down strict compositions (non-strict A025048):
  (1)  (2)  (3)    (4)    (5)    (6)      (7)      (8)
            (1,2)  (1,3)  (1,4)  (1,5)    (1,6)    (1,7)
                          (2,3)  (2,4)    (2,5)    (2,6)
                                 (1,3,2)  (3,4)    (3,5)
                                 (2,3,1)  (1,4,2)  (1,4,3)
                                          (2,4,1)  (1,5,2)
                                                   (2,5,1)
                                                   (3,4,1)
The a(1) = 1 through a(8) = 8 down/up strict compositions (non-strict A025049):
  (1)  (2)  (3)    (4)    (5)    (6)      (7)      (8)
            (2,1)  (3,1)  (3,2)  (4,2)    (4,3)    (5,3)
                          (4,1)  (5,1)    (5,2)    (6,2)
                                 (2,1,3)  (6,1)    (7,1)
                                 (3,1,2)  (2,1,4)  (2,1,5)
                                          (4,1,2)  (3,1,4)
                                                   (4,1,3)
                                                   (5,1,2)
(End)
		

Crossrefs

The case of permutations is A000111.
This is the up/down case of A032020.
This is the strict case of A129852/A129853, strong A025048/A025049.
The undirected version is A349054.
A001250 = alternating permutations, complement A348615.
A003242 = Carlitz compositions, complement A261983.
A011782 = compositions, unordered A000041.
A025047 = alternating compositions, complement A345192.
A349052 = weakly alternating compositions, complement A349053.

Programs

  • Maple
    g:= proc(u, o) option remember;
          `if`(u+o=0, 1, add(g(o-1+j, u-j), j=1..u))
        end:
    b:= proc(n, k) option remember; `if`(k<0 or n<0, 0,
          `if`(k=0, `if`(n=0, 1, 0), b(n-k, k)+b(n-k, k-1)))
        end:
    a:= n-> add(b(n, k)*g(k, 0), k=0..floor((sqrt(8*n+1)-1)/2)):
    seq(a(n), n=0..60);  # Alois P. Heinz, Dec 22 2021
  • Mathematica
    whkQ[y_]:=And@@Table[If[EvenQ[m],y[[m]]y[[m+1]]],{m,1,Length[y]-1}];
    Table[Length[Select[Join@@Permutations/@ Select[IntegerPartitions[n],UnsameQ@@#&],whkQ]],{n,0,15}] (* Gus Wiseman, Jan 15 2022 *)

Formula

G.f.: Sum_{k>=0} A000111(k)*x^(k*(k+1)/2)/Product_{i=1..k} (1-x^i). - Vladeta Jovovic, May 24 2007
a(n) = Sum_{k=0..A003056(n)} A000111(k) * A008289(n,k). - Alois P. Heinz, Dec 22 2021
a(n) = (A349054(n) + 1)/2. - Gus Wiseman, Jan 15 2022

Extensions

a(0)=1 prepended by Alois P. Heinz, Dec 22 2021
Name changed from "alternating" to "up/down" by Gus Wiseman, Jan 15 2022
Showing 1-3 of 3 results.