Ask Your Question

Revision history [back]

Just replace prime_range with a list of prime powers:

def pp(n):
    pows = [m**k for m in prime_range(n+1) if m**k < n+1]
    return Partitions(n, parts_in=pows).cardinality()

Just replace prime_range with a list of prime powers:

def pp(n):
ppk(n,k):
    pows = [m**k for m in prime_range(n+1) if m**k < n+1]
    return Partitions(n, parts_in=pows).cardinality()