OFFSET
1,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
FORMULA
Coefficient of x^(n-1) in expansion of 1/Product_{d divides n} (1-x^d). - Vladeta Jovovic, Apr 11 2004
MAPLE
with(numtheory):
a:= proc(n) option remember; local b, l; l:= sort([divisors(n)[]]):
b:= proc(m, i) option remember; `if`(m=0, 1, `if`(i<1, 0,
b(m, i-1)+`if`(l[i]>m, 0, b(m-l[i], i))))
end; forget(b):
b(n-1, nops(l))
end:
seq(a(n), n=1..100); # Alois P. Heinz, Feb 05 2014
MATHEMATICA
a[n_] := a[n] = Module[{b, l}, l = Divisors[n]; b[m_, i_] := b[m, i] = If[m==0, 1, If[i<1, 0, b[m, i-1] + If[l[[i]]>m, 0, b[m-l[[i]], i]]]]; b[n-1, Length[l]]]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Apr 07 2015, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved