1 | initial version |
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()
2 | No.2 Revision |
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()