OFFSET
0,4
COMMENTS
Number of partitions whose summands can be divided into two sets whose sums are equal, or whose sums differ by one.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..115 (first 77 terms from Chai Wah Wu)
FORMULA
EXAMPLE
For example: the partition of 6 into 2+2+2 is not counted because no subset of {2,2,2} has the sum 3. The partition of 6 into 3+2+1 is counted because {3,2,1} can be divided into two subsets {3} and {2,1} each of which has sum 3. The partition of 7 into 4+2+1 is counted because {4,2,1} can be broken up into sets {4} and {2,1} the sum of whose elements differ by one.
MAPLE
N:= 50: # to get a(0) .. a(N)
Pm1:= combinat:-partition(0);
for m from 0 to N/2 do
Pm:= Pm1;
A[2*m]:= nops({seq(seq(sort([op(Pm[i]), op(Pm[j])]), j=1..i), i=1..nops(Pm))});
if 2*m+1 > N then break fi;
Pm1:= combinat:-partition(m+1);
A[2*m+1]:= nops({seq(seq(sort([op(Pm[i]), op(Pm1[j])]), j=1..nops(Pm1)), i=1..nops(Pm))});
od:
seq(A[i], i= 0..N); # Robert Israel, Aug 18 2016
PROG
(Python)
from collections import Counter
from sympy.utilities.iterables import partitions
def A276107(n): return len({tuple(sorted((p+q).items())) for p in (Counter(p) for p in partitions(n>>1)) for q in (Counter(q) for q in partitions(n+1>>1))}) # Chai Wah Wu, Sep 20 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
David S. Newman, Aug 18 2016
EXTENSIONS
a(11)-a(47) from Alois P. Heinz, Aug 18 2016
STATUS
approved