A239871 Number of strict partitions of n having 1 more even part than odd, so that there is at least one ordering of the parts in which the even and odd parts alternate, and the first and last terms are even.
0, 0, 1, 0, 1, 0, 1, 1, 1, 2, 1, 4, 1, 6, 1, 9, 2, 12, 3, 16, 6, 20, 10, 25, 17, 30, 26, 36, 40, 43, 57, 51, 81, 61, 110, 74, 148, 91, 193, 113, 250, 144, 316, 184, 397, 239, 491, 311, 603, 407, 732, 530, 885, 692, 1061, 895, 1268, 1155, 1508, 1478, 1790
Offset: 0
Examples
a(11) counts these 4 partitions: 812, 614, 632, 452.
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..1000
Programs
-
Maple
b:= proc(n, i, t) option remember; `if`(n>i*(i+1)/2 or abs(t)>n, 0, `if`(n=0, 1, b(n, i-1, t)+ `if`(i>n, 0, b(n-i, i-1, t+(2*irem(i, 2)-1))))) end: a:= n-> b(n$2, 1): seq(a(n), n=0..80); # Alois P. Heinz, Apr 02 2014
-
Mathematica
d[n_] := Select[IntegerPartitions[n], Max[Length /@ Split@#] == 1 &]; p[n_] := p[n] = Select[d[n], Count[#, ?OddQ] == -1 + Count[#, ?EvenQ] &]; t = Table[p[n], {n, 0, 20}] TableForm[t] (* shows the partitions *) u = Table[Length[p[n]], {n, 0, 70}] (* A239871 *) (* Peter J. C. Moses, Mar 10 2014 *) b[n_, i_, t_] := b[n, i, t] = If[n > i*(i + 1)/2 || Abs[t] > n, 0, If[n == 0, 1, b[n, i - 1, t] + If[i > n, 0, b[n - i, i - 1, t + (2*Mod[i, 2] - 1)]]]]; a[n_] := b[n, n, 1]; Table[a[n], {n, 0, 80}] (* Jean-François Alcover, Nov 16 2015, after Alois P. Heinz *)
Formula
a(n) = [x^n y^(-1)] Product_{i>=1} 1+x^i*y^(2*(i mod 2)-1). - Alois P. Heinz, Apr 03 2014
Comments