login
a(0)=1; for n >= 1, a(n) is the number of subsets of [a(0), a(1), ..., a(n-1)] whose sum is equal to a(n-1).
2

%I #50 Jan 24 2024 16:33:15

%S 1,1,2,2,3,5,6,8,11,17,25,33,41,52,80,139,204,245,289,410,692,1159,

%T 1477,2010,2769,4247,6128,7709,9817,14071,21982,34892,52079,63998,

%U 81167,122709,183662,267520,382690,521361,725601,1050579,1541163,2084690,2829408

%N a(0)=1; for n >= 1, a(n) is the number of subsets of [a(0), a(1), ..., a(n-1)] whose sum is equal to a(n-1).

%H Alois P. Heinz, <a href="/A265853/b265853.txt">Table of n, a(n) for n = 0..85</a> (first 71 terms from Bert Dobbelaere)

%F a(0) = 1; a(n) = [x^a(n-1)] Product_{k=0..n-1} (1 + x^a(k)). - _Ilya Gutkovskiy_, Jan 24 2024

%e a(4) = 3 because there are subsets of [1, 1, 2, 2] that sum to a(3) = 2: {1, 1}, {2}, {2}.

%p s:= proc(n) option remember; `if`(n<0, 0, s(n-1)+a(n)) end:

%p b:= proc(n, i) option remember; `if`(n=0, 1, `if`(s(i)<n, 0,

%p b(n, i-1)+ (p-> `if`(p>=0, b(p, i-1), 0))(n-a(i))))

%p end:

%p a:= n-> `if`(n=0, 1, b(a(n-1), n-1)):

%p seq(a(n), n=0..44); # _Alois P. Heinz_, Jan 24 2024

%t lst={1};n=1;While[n<30, lst = Join[lst, {Length@Select[Total /@ Subsets[lst],#==Last[lst]&]}];n++]

%Y Cf. A057601.

%K nonn

%O 0,3

%A _Melvin Peralta_, Dec 21 2015

%E More terms from _Bert Dobbelaere_, Oct 28 2018