OFFSET
0,5
LINKS
Seiichi Manyama, Table of n, a(n) for n = 0..10000
E. Grosswald, Partitions into prime powers
FORMULA
G.f.: Prod(p prime, Prod(k >= 1, 1/(1-x^(p^k))))
EXAMPLE
From Gus Wiseman, Jul 28 2022: (Start)
The a(0) = 1 through a(9) = 7 partitions:
() . (2) (3) (4) (5) (33) (7) (8) (9)
(22) (32) (42) (43) (44) (54)
(222) (52) (53) (72)
(322) (332) (333)
(422) (432)
(2222) (522)
(3222)
(End)
MATHEMATICA
Table[Length[Select[IntegerPartitions[n], And@@PrimePowerQ/@#&]], {n, 0, 30}] (* Gus Wiseman, Jul 28 2022 *)
PROG
(PARI) is_primepower(n)= {ispower(n, , &n); isprime(n)}
lista(m) = {x = t + t*O(t^m); gf = prod(k=1, m, if (is_primepower(k), 1/(1-x^k), 1)); for (n=0, m, print1(polcoeff(gf, n, t), ", ")); }
\\ Michel Marcus, Mar 09 2013
(Python)
from functools import lru_cache
from sympy import factorint
@lru_cache(maxsize=None)
def A023894(n):
@lru_cache(maxsize=None)
def c(n): return sum((p**(e+1)-p)//(p-1) for p, e in factorint(n).items())
return (c(n)+sum(c(k)*A023894(n-k) for k in range(1, n)))//n if n else 1 # Chai Wah Wu, Jul 15 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved