OFFSET
0,7
MAPLE
b:= proc(n) option remember; `if`(n<2, 1, expand(b(n-1)*(1+x^ithprime(n)))) end:
a:= n-> max(coeffs(b(n))):
seq(a(n), n=0..40); # Alois P. Heinz, Jan 29 2024
MATHEMATICA
Table[Max[CoefficientList[Product[(1 + x^Prime[k]), {k, 2, n}], x]], {n, 0, 40}]
PROG
(PARI) a(n) = vecmax(Vec(prod(i=2, n, 1+x^prime(i)))); \\ Michel Marcus, Jan 29 2024
(Python)
from collections import Counter
from sympy import prime
def A369708(n):
c = {0:1}
for i in range(2, n+1):
p, d = prime(i), Counter(c)
for k in c:
d[k+p] += c[k]
c = d
return max(c.values()) # Chai Wah Wu, Jan 31 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Jan 29 2024
STATUS
approved