login
Total sum of the elements in all nondecreasing sequences s1, s2, ..., s_n of powers of 2 such that s_i <= 1 + Sum_{j=1..i-1} s_j.
3

%I #14 May 02 2022 03:22:18

%S 0,1,5,19,72,260,923,3243,11313,39275,135938,469544,1619688,5582154,

%T 19227215,66200580,227874107,784248508,2698752555,9286235592,

%U 31951747845,109934789410,378238848290,1301340023409,4477248965334,15403837196135,52996202385909

%N Total sum of the elements in all nondecreasing sequences s1, s2, ..., s_n of powers of 2 such that s_i <= 1 + Sum_{j=1..i-1} s_j.

%H Alois P. Heinz, <a href="/A343799/b343799.txt">Table of n, a(n) for n = 0..1863</a>

%e a(0) = 0: [].

%e a(1) = 1: [1].

%e a(2) = 5 = 2+3: [1,1], [1,2].

%e a(3) = 19 = 3+4+5+7: [1,1,1], [1,1,2], [1,2,2], [1,2,4].

%e a(4) = 72 = 4+5+7+6+8+7+9+11+15: [1,1,1,1], [1,1,1,2], [1,1,1,4], [1,1,2,2], [1,1,2,4], [1,2,2,2], [1,2,2,4], [1,2,4,4], [1,2,4,8].

%e a(5) = 260 = 5+6+8+7+9+11+15+8+10+12+16+9+11+15+13+17+15+19+23+31: [1,1,1,1,1], [1,1,1,1,2], [1,1,1,1,4], [1,1,1,2,2], [1,1,1,2,4], [1,1,1,4,4], [1,1,1,4,8], [1,1,2,2,2], [1,1,2,2,4], [1,1,2,4,4], [1,1,2,4,8], [1,2,2,2,2], [1,2,2,2,4], [1,2,2,2,8], [1,2,2,4,4], [1,2,2,4,8], [1,2,4,4,4], [1,2,4,4,8], [1,2,4,8,8], [1,2,4,8,16].

%p b:= proc(n, t) option remember; `if`(n=0, [1, 0],

%p `if`(t=0, 0, (p-> p+[0, p[2]])(b(n, iquo(t, 2)))+

%p (p-> p+[0, p[1]])(b(n-1, t+1))))

%p end:

%p a:= n-> b(n, 1)[2]:

%p seq(a(n), n=0..30);

%t b[n_, t_] := b[n, t] = If[n == 0, {1, 0}, If[t == 0, {0, 0},

%t With[{p = b[n, Quotient[t, 2]]}, p + {0, p[[2]]}] +

%t With[{p = b[n - 1, t + 1]}, p + {0, p[[1]]}]]];

%t a[n_] := b[n, 1][[2]];

%t Table[a[n], {n, 0, 30}] (* _Jean-François Alcover_, May 02 2022, after _Alois P. Heinz_ *)

%Y Cf. A343756, A343801.

%K nonn

%O 0,3

%A _Alois P. Heinz_, Apr 29 2021