A189357 Number of partitions of n into distinct parts where all differences between consecutive parts are even.
1, 1, 1, 1, 2, 1, 3, 1, 4, 2, 5, 2, 7, 3, 8, 4, 11, 5, 13, 6, 17, 8, 20, 9, 26, 12, 30, 14, 38, 17, 45, 20, 55, 25, 64, 29, 79, 35, 91, 41, 110, 49, 128, 57, 152, 68, 176, 78, 209, 93, 240, 107, 282, 125, 325, 144, 379, 168, 434, 192, 505, 223, 576, 255, 666, 294, 760, 335, 873, 385, 993, 437, 1139
Offset: 0
Keywords
Examples
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)
Links
- Paul D. Hanna, Table of n, a(n) for n = 0..1000
Crossrefs
Programs
-
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 */
-
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 )
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]
Comments