cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A360674 Number of integer partitions of 2n whose left half (exclusive) and right half (inclusive) both sum to n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Mar 04 2023

Keywords

Comments

Of course, only one of the two conditions is necessary.

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

The even-length case is A000005.
Central diagonal of A360672.
These partitions have ranks A360953.
A008284 counts partitions by length, row sums A000041.
A359893 and A359901 count partitions by median.
First for prime indices, second for partitions, third for prime factors:
- A360676 gives left sum (exclusive), counted by A360672, product A361200.
- A360677 gives right sum (exclusive), counted by A360675, product A361201.
- A360678 gives left sum (inclusive), counted by A360675, product A347043.
- A360679 gives right sum (inclusive), counted by A360672, product A347044.

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