OFFSET
0,4
LINKS
FORMULA
a(n) = [x^n] 1/(1 - Sum_{d|n, d positive odd} x^d).
a(n) = 1 if n is a power of 2.
a(n) = 2 if n is an odd prime.
EXAMPLE
a(10) = 8 because 10 has 4 divisors {1, 2, 5, 10} among which 2 are odd {1, 5} therefore we have [5, 5], [5, 1, 1, 1, 1, 1], [1, 5, 1, 1, 1, 1], [1, 1, 5, 1, 1, 1], [1, 1, 1, 5, 1, 1], [1, 1, 1, 1, 5, 1], [1, 1, 1, 1, 1, 5] and [1, 1, 1, 1, 1, 1, 1, 1, 1, 1].
MAPLE
with(numtheory):
a:= proc(n) option remember; local b, l;
l, b:= select(x-> is(x:: odd), divisors(n)),
proc(m) option remember; `if`(m=0, 1,
add(`if`(j>m, 0, b(m-j)), j=l))
end; b(n)
end:
seq(a(n), n=0..60); # Alois P. Heinz, Mar 30 2017
MATHEMATICA
Table[d = Divisors[n]; Coefficient[Series[1/(1 - Sum[Boole[Mod[d[[k]], 2] == 1] x^d[[k]], {k, Length[d]}]), {x, 0, n}], x, n], {n, 0, 57}]
PROG
(Python)
from sympy import divisors
from sympy.core.cache import cacheit
@cacheit
def a(n):
l=[x for x in divisors(n) if x%2]
@cacheit
def b(m): return 1 if m==0 else sum(b(m - j) for j in l if j <= m)
return b(n)
print([a(n) for n in range(61)]) # Indranil Ghosh, Aug 01 2017, after Maple code
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Mar 27 2017
STATUS
approved