A360674 Number of integer partitions of 2n whose left half (exclusive) and right half (inclusive) both sum to n.
1, 1, 3, 4, 7, 6, 12, 9, 16, 15, 21, 16, 34, 22, 33, 36, 47, 36, 62, 44, 75, 68, 78, 68, 120, 93, 113, 117, 151, 122, 195, 148, 209, 197, 220, 226, 315, 249, 304, 309, 402, 332, 463, 387, 496, 515, 539, 514, 712, 609, 738, 723, 845, 774, 983, 914, 1111
Offset: 0
Keywords
Examples
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).
Crossrefs
Programs
-
Mathematica
Table[Length[Select[IntegerPartitions[2n], Total[Take[#,Floor[Length[#]/2]]]==n&]],{n,0,15}]
-
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
Formula
a(n) = A360672(2n,n).
Extensions
More terms from David Consiglio, Jr., Mar 09 2023
Comments