OFFSET
0,9
FORMULA
EXAMPLE
a(16) = 3 because we have [13, 3], [11, 5] and [7, 5, 3, 1].
MAPLE
s:= proc(n) option remember;
`if`(n<1, n+1, ithprime(n)+s(n-1))
end:
b:= proc(n, i, t) option remember; (p-> `if`(n=0, t,
`if`(n>s(i), 0, b(n, i-1, t)+ `if`(p>n, 0,
b(n-p, i-1, 1-t)))))(`if`(i<1, 1, ithprime(i)))
end:
a:= n-> b(n, numtheory[pi](n), 1):
seq(a(n), n=0..100); # Alois P. Heinz, Dec 02 2020
MATHEMATICA
nmax = 75; CoefficientList[Series[(1/2) ((1 + x) Product[(1 + x^Prime[k]), {k, 1, nmax}] + (1 - x) Product[(1 - x^Prime[k]), {k, 1, nmax}]), {x, 0, nmax}], x]
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Dec 02 2020
STATUS
approved