OFFSET
0,3
COMMENTS
Of course, only one of the two conditions is necessary.
FORMULA
a(n) = A360672(2n,n).
EXAMPLE
The a(1) = 1 through a(6) = 12 partitions:
(11) (22) (33) (44) (55) (66)
(211) (321) (422) (532) (633)
(1111) (21111) (431) (541) (642)
(111111) (2222) (32221) (651)
(22211) (211111111) (3333)
(2111111) (1111111111) (33222)
(11111111) (33321)
(42222)
(222222)
(2222211)
(21111111111)
(111111111111)
For example, the partition y = (3,2,2,2,1) has halves (3,2) and (2,2,1), both with sum 5, so y is counted under a(5).
MATHEMATICA
Table[Length[Select[IntegerPartitions[2n], Total[Take[#, Floor[Length[#]/2]]]==n&]], {n, 0, 15}]
PROG
(Python)
def accel_asc(n):
a = [0 for i in range(n + 1)]
k = 1
y = n - 1
while k != 0:
x = a[k - 1] + 1
k -= 1
while 2 * x <= y:
a[k] = x
y -= x
k += 1
l = k + 1
while x <= y:
a[k] = x
a[l] = y
yield a[:k + 2]
x += 1
y -= 1
a[k] = x + y
y = x + y - 1
yield a[:k + 1]
for y in range(1000):
num = 0
for x in accel_asc(2*y):
stop = len(x)//2+1
if len(x) % 2 == 0:
stop -= 1
right = x[0:stop]
left = x[stop:]
if sum(right) == sum(left):
num += 1
print(y, num)
# David Consiglio, Jr., Mar 09 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Mar 04 2023
EXTENSIONS
More terms from David Consiglio, Jr., Mar 09 2023
STATUS
approved