Ask Your Question

Revision history [back]

Up to the remarks I made in the comments above, the main question is about how to compute rather efficiently P_k(n). One has to tweak a bit since polynomials are not always efficient. The following function computes the generating series of the P_k(n).

def power_partition_generating_series(s, n=20):
    r"""
    Return the generating series of the s-th power partition function up to O(q^n).
    """
    R = ZZ['q']
    ans = R.one()
    m = 1
    while m**s < n:
        l = [0] * n
        l[0] = 1
        for i in range(1, (n + m**s - 1) // m**s):
            l[i*m**s] = 1
        ans = ans._mul_trunc_(R(l), n)
        m += 1
    return ans

From it, you can naively run through the first coefficients to see whether it looks like it stabilizes.

%%time
seq = power_partition_generating_series(4, 1500000).coefficients()
last_neg = None
for n in range(2, len(seq) - 1):
    d = seq[n]**2 / seq[n-1] / seq[n+1]
    if d < 1:
        last_neg = n
print(last_neg)

gives me

print(last_neg)

637854
CPU times: user 1min, sys: 3.27 s, total: 1min 3s
Wall time: 1min 3s

Hence, your next term is plausibly N_4 = 6378551.

Up to the remarks I made in the comments above, the main question is about how to compute rather efficiently P_k(n). One has to tweak a bit since polynomials are polynomiak arithmetic is not always efficient. efficient in sage. The following function computes the generating series of the P_k(n).

def power_partition_generating_series(s, n=20):
    r"""
    Return the generating series of the s-th power partition function up to O(q^n).
    """
    R = ZZ['q']
    ans = R.one()
    m = 1
    while m**s < n:
        l = [0] * n
        l[0] = 1
        for i in range(1, (n + m**s - 1) // m**s):
            l[i*m**s] = 1
        ans = ans._mul_trunc_(R(l), n)
        m += 1
    return ans

From it, you can naively run through the first coefficients to see whether it looks like it stabilizes.

%%time
seq = power_partition_generating_series(4, 1500000).coefficients()
last_neg = None
for n in range(2, len(seq) - 1):
    d = seq[n]**2 / seq[n-1] / seq[n+1]
    if d < 1:
        last_neg = n
print(last_neg)

gives me

print(last_neg)

637854
CPU times: user 1min, sys: 3.27 s, total: 1min 3s
Wall time: 1min 3s

Hence, your next term is plausibly N_4 = 6378551.

Up to the remarks I made in the comments above, the main question is about how to compute rather efficiently P_k(n). One has to tweak a bit since polynomiak arithmetic is not always efficient in sage. The following function computes the generating series of the P_k(n).

def power_partition_generating_series(s, n=20):
    r"""
    Return the generating series of the s-th power partition function up to O(q^n).
    """
    R = ZZ['q']
    ans = R.one()
    m = 1
    while m**s < n:
        l = [0] * n
        l[0] = 1
        for i in range(1, (n + m**s - 1) // m**s):
            l[i*m**s] = 1
        ans = ans._mul_trunc_(R(l), n)
        m += 1
    return ans

From it, you can naively run through the first coefficients to see whether it looks like it stabilizes.

%%time
seq = power_partition_generating_series(4, 1500000).coefficients()
last_neg = None
for n in range(2, len(seq) - 1):
    d = seq[n]**2 / seq[n-1] / seq[n+1]
    if d < 1:
        last_neg = n
print(last_neg)

gives me

print(last_neg)

637854
CPU times: user 1min, sys: 3.27 s, total: 1min 3s
Wall time: 1min 3s

Hence, your next term is plausibly N_4 = 6378551.

Up to the remarks I made in the comments above, the main question is about how to compute rather efficiently P_k(n). One has to tweak a bit since polynomiak arithmetic is not always efficient in sage. The following function computes the generating series of the P_k(n).

def power_partition_generating_series(s, n=20):
    r"""
    Return the generating series of the s-th power partition function up to O(q^n).
    """
    R = ZZ['q']
    ans = R.one()
    m = 1
    while m**s < n:
        l = [0] * n
        l[0] = 1
        for i in range(1, (n + m**s - 1) // m**s):
            l[i*m**s] = 1
        ans = ans._mul_trunc_(R(l), n)
        m += 1
    return ans

From it, you can naively run through the first coefficients to see whether it looks like it stabilizes.

%%time
seq = power_partition_generating_series(4, 1500000).coefficients()
last_neg = None
for n in range(2, len(seq) - 1):
    d = seq[n]**2 / seq[n-1] / seq[n+1]
    if d < 1:
        last_neg = n
print(last_neg)

gives me

637854
CPU times: user 1min, sys: 3.27 s, total: 1min 3s
Wall time: 1min 3s

Hence, your next term is plausibly N_4 = 6378551637855.

Up to the remarks I made in the comments above, the main question is about how to compute rather efficiently P_k(n). One has to tweak a bit since polynomiak arithmetic is not always efficient in sage. The following function computes the generating series of the P_k(n).

def power_partition_generating_series(s, n=20):
    r"""
    Return the generating series of the s-th power partition function up to O(q^n).
    """
    R = ZZ['q']
    ans = R.one()
    m = 1
    while m**s < n:
        l = [0] * n
        l[0] = 1
        for i in range(1, (n + m**s - 1) // m**s):
            l[i*m**s] = 1
        ans = ans._mul_trunc_(R(l), n)
        m += 1
    return ans

From it, you can naively run through the first coefficients to see whether it looks like it stabilizes.

%%time
seq = power_partition_generating_series(4, 1500000).coefficients()
last_neg = None
for n in range(2, len(seq) - 1):
    d = seq[n]**2 / seq[n-1] / seq[n+1]
    if d < 1:
        last_neg = n
print(last_neg)

gives me

637854
CPU times: user 1min, sys: 3.27 s, total: 1min 3s
Wall time: 1min 3s

Hence, your next term is plausibly N_4 = 637855.