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
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)
Ranking sequences are put in parentheses below.
The unordered case (partitions) is
A065033.
Cf.
A000111,
A008965,
A015723,
A114901,
A128761,
A129852,
A129853,
A218074,
A333213,
A344614,
A345164,
A345194,
A349060,
A349795.
-
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
-
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}]
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
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
- Andrew Howroyd, Table of n, a(n) for n = 0..1000
- M. Archibald, A. Blecher, A. Knopfmacher, and M. E. Mays, Inversions and Parity in Compositions of Integers, J. Int. Seq., Vol. 23 (2020), Article 20.4.1.
- Anders Claesson, Atli Fannar FranklĂn, and Einar SteingrĂmsson, Permutations with few inversions, arXiv:2305.09457 [math.CO], 2023.
- S. Heubach, A. Knopfmacher, M. E. Mays and A. Munagi, Inversions in Compositions of Integers, Quaestiones Mathematicae 34 (2011), 187-202.
Cf.
A218074 (up-steps in partitions into distinct parts).
-
a:= proc(n) uses combinat; add(numbpart(k), k=0..n-1)-numbpart(n) end:
seq(a(n), n=0..49);
-
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 *)
-
a(n) = {sum(k=0, n-1, numbpart(k)) - numbpart(n)} \\ Andrew Howroyd, Apr 21 2023
-
Vec((2*x - 1)/(1 - x)/eta(x + O(x^51))) \\ Andrew Howroyd, Apr 21 2023
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
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)
The case of permutations is
A000111.
This is the up/down case of
A032020.
Cf.
A003056,
A008289,
A008965,
A015723,
A072706,
A128761,
A218074,
A345165,
A345170,
A345195,
A349800.
-
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
-
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 *)
Name changed from "alternating" to "up/down" by
Gus Wiseman, Jan 15 2022
Showing 1-3 of 3 results.
Comments