OFFSET
0,5
COMMENTS
Also number of partitions into distinct parts where either all parts are even or all parts are odd.
Also number of symmetric unimodal compositions of n where the maximal part m appears at least m times, see example. [Joerg Arndt, Jun 11 2013]
LINKS
Paul D. Hanna, Table of n, a(n) for n = 0..1000
FORMULA
G.f.: -1 + prod(n>=1, 1+x^(2*n) ) + prod(n>=1, 1+x^(2*n-1) ).
G.f.: -1 + sum(n>=0, x^(n^2)*(1+x^n) / prod(k=1..n, 1-x^(2*k)) ). [Joerg Arndt, Jan 27 2011]
EXAMPLE
a(14)=8 because there are 8 such partitions of 14: 1+13 =2+4+8 =2+12 =3+11 =4+10 =5+9 =6+8 =14
G.f.: A(x) = 1 + x + x^2 + x^3 + 2*x^4 + x^5 + 3*x^6 + x^7 + 4*x^8 + 2*x^9 +...
From Joerg Arndt, Jun 11 2013: (Start)
There are a(18)=13 symmetric unimodal compositions of 18 where the maximal part m appears at least m times:
01: [ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ]
02: [ 1 1 1 1 1 1 1 2 2 1 1 1 1 1 1 1 ]
03: [ 1 1 1 1 1 1 2 2 2 1 1 1 1 1 1 ]
04: [ 1 1 1 1 1 2 2 2 2 1 1 1 1 1 ]
05: [ 1 1 1 1 2 2 2 2 2 1 1 1 1 ]
06: [ 1 1 1 2 2 2 2 2 2 1 1 1 ]
07: [ 1 1 1 3 3 3 3 1 1 1 ]
08: [ 1 1 2 2 2 2 2 2 2 1 1 ]
09: [ 1 2 2 2 2 2 2 2 2 1 ]
10: [ 1 2 3 3 3 3 2 1 ]
11: [ 1 4 4 4 4 1 ]
12: [ 2 2 2 2 2 2 2 2 2 ]
13: [ 3 3 3 3 3 3 ]
(End)
PROG
(Sage)
def A189357(n):
works = lambda part: all(x % 2 == 0 for x in differences(part))
def count(pred, iter): return sum(1 for item in iter if pred(item))
return count(works, Partitions(n, max_slope=-1))
print([A189357(n) for n in range(0, 30)])
# D. S. McNeil, Apr 21 2011 (updated to Python3 by Peter Luschny, Mar 06 2020 )
(PARI) {a(n)=polcoeff(-1 + prod(m=1, n\1, 1+x^(2*m))+prod(m=1, n\2+1, 1+x^(2*m-1))+x*O(x^n), n)} /* Paul D. Hanna */
(PARI) {a(n)=polcoeff(-1 + sum(m=0, sqrtint(n+1), x^(m^2)*(1+x^m)/prod(k=1, m, 1-x^(2*k)+x*O(x^n))), n)} /* Paul D. Hanna */
CROSSREFS
KEYWORD
nonn
AUTHOR
Joerg Arndt, Apr 20 2011
STATUS
approved