OFFSET
1,3
EXAMPLE
n=10: A000040(10) = 29 = 27+2 = 26+3 = 25+4 = 24+5 = 23+6 = 22+7
= 21+8 = 20+9 = 19+10 = 19+7+3 = 19+5+3+2 = 18+11 = 17+12 = 17+7+5 =
17+7+3+2 = 17+5+4+3 = 16+13 = 15+14 = 15+7+4+3 = 13+11+5 = 13+11+3+2 =
13+9+7 = 13+9+5+2 = 13+7+5+4 = 11+9+7+2 = 11+9+5+4 = 11+8+7+3 = 11+7+6+5 =
9+8+7+5: a(10)=30.
MATHEMATICA
b[n_, i_, s_] := b[n, i, s] = Module[{f}, If[n == 0 || i == 1, 1, If[i<2, 0, f = FactorInteger[i][[All, 1]]; b[n, i-1, Select[s, #<i&]] + If[i <= n && f~Intersection~s == {}, b[n-i, i-1, Select[s~Union~f, #<i&]], 0]]]];
c[n_] := b[n, n, {}] - b[n-1, n-1, {}];
a[n_] := c[Prime[n]];
Table[Print[n, " ", a[n]]; a[n]; a[n], {n, 1, 60}] (* Jean-François Alcover, Oct 06 2021, after Alois P. Heinz in A007359 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Aug 27 2003
STATUS
approved