OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..85 (first 71 terms from Bert Dobbelaere)
FORMULA
a(0) = 1; a(n) = [x^a(n-1)] Product_{k=0..n-1} (1 + x^a(k)). - Ilya Gutkovskiy, Jan 24 2024
EXAMPLE
a(4) = 3 because there are subsets of [1, 1, 2, 2] that sum to a(3) = 2: {1, 1}, {2}, {2}.
MAPLE
s:= proc(n) option remember; `if`(n<0, 0, s(n-1)+a(n)) end:
b:= proc(n, i) option remember; `if`(n=0, 1, `if`(s(i)<n, 0,
b(n, i-1)+ (p-> `if`(p>=0, b(p, i-1), 0))(n-a(i))))
end:
a:= n-> `if`(n=0, 1, b(a(n-1), n-1)):
seq(a(n), n=0..44); # Alois P. Heinz, Jan 24 2024
MATHEMATICA
lst={1}; n=1; While[n<30, lst = Join[lst, {Length@Select[Total /@ Subsets[lst], #==Last[lst]&]}]; n++]
CROSSREFS
KEYWORD
nonn
AUTHOR
Melvin Peralta, Dec 21 2015
EXTENSIONS
More terms from Bert Dobbelaere, Oct 28 2018
STATUS
approved