OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
Eric Weisstein's World of Mathematics, Prime Power
FORMULA
a(n) = [x^n] 1/(1 - x - Sum_{p^k|n, p prime, k>=1} x^(p^k)).
a(n) = 2 if n is a prime.
EXAMPLE
a(4) = 6 because 4 has 3 divisors {1, 2, 4} and all are prime powers therefore we have [4], [2, 2], [2, 1, 1], [1, 2, 1], [1, 1, 2] and [1, 1, 1, 1].
MAPLE
with(numtheory):
a:= proc(n) local d, b; d, b:= select(x->
nops(factorset(x))<2, divisors(n)),
proc(n) option remember; `if`(n=0, 1,
add(`if`(j>n, 0, b(n-j)), j=d))
end: b(n)
end:
seq(a(n), n=0..60); # Alois P. Heinz, Apr 15 2017
MATHEMATICA
Table[d = Divisors[n]; Coefficient[Series[1/(1 - x - Sum[Boole[PrimePowerQ[d[[k]]]] x^d[[k]], {k, Length[d]}]), {x, 0, n}], x, n], {n, 0, 47}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Apr 03 2017
STATUS
approved