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.

Showing 1-2 of 2 results.

A321440 Number of partitions of n into consecutive parts, all singletons except the largest.

Original entry on oeis.org

1, 1, 2, 3, 3, 4, 5, 4, 5, 7, 5, 6, 8, 5, 8, 10, 5, 8, 10, 7, 10, 11, 7, 8, 13, 9, 9, 14, 7, 12, 15, 6, 12, 13, 11, 15, 14, 8, 10, 19, 10, 12, 18, 8, 16, 19, 9, 12, 17, 14, 16, 16, 10, 15, 21, 15, 14, 20, 7, 16, 25, 7, 20, 21, 14, 18, 18, 14, 12, 26, 16, 17
Offset: 0

Views

Author

Allan C. Wechsler, Nov 09 2018

Keywords

Comments

Number of representations of n as the difference of two distinct triangular numbers, plus any multiple of the order of the larger triangular number.
From Jeremy Lovejoy, Nov 10 2022: (Start)
For n > 0, a(n) is also equal to the Hurwitz class number H(8n-1).
a(n) is also equal to the number of partitions y of n having no repeated even parts and smallest part odd, counted according to the weight w(y) = (-1)^(the number of even parts)*(the number of occurrences of the smallest part). For example, the partitions of 6 having no repeated even parts and smallest part odd are [5,1], [4,1,1], [3,3], [3,2,1], [3,1,1,1], [2,1,1,1,1], and [1,1,1,1,1,1], which are counted with weights 1,-2,2,-1,3,-4, and 6, giving a(6) = 1-2+2-1+3-4+6 = 5. (End)

Examples

			Here are the derivations of the terms given. Partitions are listed as strings of digits.
n = 0: (empty partition)
n = 1: 1
n = 2: 11, 2
n = 3: 111, 12, 3
n = 4: 1111, 22, 4
n = 5: 11111, 122, 23, 5
n = 6: 111111, 123, 222, 33, 6
n = 7: 1111111, 1222, 34, 7
n = 8: 11111111, 2222, 233, 44, 8
n = 9: 111111111, 12222, 1233, 234, 333, 45, 9
n = 10: 1111111111, 1234, 22222, 55, (10)
		

Crossrefs

See comment by Emeric Deutsch at A001227 (partitions into consecutive parts, all singletons); the partitions considered in the present sequence are a superset of those described by Deutsch.

Programs

  • Python
    from sympy.utilities.iterables import partitions
    def A321440(n):
        return 1 if n == 0 else sum(1 for s,p in partitions(n,size=True) if len(p)-1 == max(p)-min(p) == s-p[max(p)]) # Chai Wah Wu, Nov 09 2018
    
  • Python
    from _future_ import division
    def A321440(n): # a faster program based on the characterization in the comments
        if n == 0:
            return 1
        c = 0
        for i in range(n):
            mi = i*(i+1)//2 + n
            for j in range(i+1,n+1):
                k = mi - j*(j+1)//2
                if k < 0:
                    break
                if not k % j:
                    c += 1
        return c # Chai Wah Wu, Nov 09 2018

Formula

From Jeremy Lovejoy, Nov 10 2022: (Start)
G.f.: 1 + Sum_{n>=0} x^(n+1)*Product_{k=1..n} (1-x^(2*k))/Product_{k=1..n+1} (1-x^(2*k-1)).
G.f.: 1 + Sum_{n>=1} (-1)^(n+1)*x^(n^2)/((1-x^(2*n-1))*Product_{k=1..n} (1-x^(2*k-1))). (End)

Extensions

More terms from Chai Wah Wu, Nov 09 2018

A321443 Number of "bilaterally symmetric hexagonal partitions" of n.

Original entry on oeis.org

1, 1, 2, 2, 4, 2, 5, 3, 5, 4, 7, 2, 8, 4, 7, 5, 9, 2, 11, 5, 8, 5, 10, 4, 13, 6, 8, 5, 13, 4, 16, 4, 8, 8, 14, 5, 16, 5, 11, 7, 16, 2, 17, 9, 12, 8, 13, 4, 20, 8, 14, 7, 15, 5, 22, 7, 11, 8, 20, 4, 23, 8, 10, 11, 20, 7, 20, 4, 17, 9, 24, 5, 22, 7, 13, 13, 16
Offset: 0

Views

Author

Allan C. Wechsler, Nov 09 2018

Keywords

Comments

A bilaterally symmetric hexagonal partition is one whose parts are consecutive integers, of which all have multiplicity 2 except the largest part, which may have any multiplicity (including 1).
This is a restriction of the concept of hexagonal partition presented in A321441. The nomenclature is suggested by presenting such partitions as hexagonal patches of the triangular lattice A2.

Examples

			Here are the derivations of the terms up through n = 10. Partitions are abbreviated as strings of digits.
n = 0: (empty partition)
n = 1: 1
n = 2: 11, 2
n = 3: 111, 3
n = 4: 1111, 112, 22, 4
n = 5: 11111, 5
n = 6: 111111, 1122, 222, 33, 6
n = 7: 1111111, 223, 7
n = 8: 11111111, 11222, 2222, 44, 8
n = 9: 111111111, 11223, 333, 9
n = 10: 1111111111, 112222, 22222, 2233, 334, 55, (10)
		

Crossrefs

A321441 counts hexagonal partitions in general. A321440 counts a different special kind of hexagonal partition. A116513 counts hexagonal "diagrams", of which these partitions are a sort of projection.

Programs

  • Python
    def A321443(n):
        if n == 0:
            return 1
        c = 0
        for i in range(n):
            mi = i*(i+1) + n
            for j in range(i+1,n+1):
                k = mi - j*j
                if k < 0:
                    break
                if not k % j:
                    c += 1
        return c # Chai Wah Wu, Nov 10 2018

Extensions

More terms from Chai Wah Wu, Nov 10 2018
Showing 1-2 of 2 results.