proposed
approved
proposed
approved
editing
proposed
(* Second program: *)
b[n_, i_] := b[n, i] = If[n == 0, 1, Sum[b[n - j, j],
{j, If[i == 0, Range[n], Select[{i, 2i}, # <= n&]]}]];
a[n_] := b[n, 0];
a /@ Range[0, 80] (* Jean-François Alcover, Jun 03 2021, after Alois P. Heinz *)
approved
editing
editing
approved
b:= proc(n, i) option remember; `if`(n=0, 1, add(b(n-j, j),
j=`if`(i=0, 1..n, select(x-> x<=n, [i, 2*i]))))
end:
a:= n-> b(n, 0):
seq(a(n), n=0..80); # Alois P. Heinz, May 24 2021
approved
editing
editing
approved
Alois P. Heinz, <a href="/A342337/b342337.txt">Table of n, a(n) for n = 0..10000</a>
approved
editing
proposed
approved
editing
proposed
1, 1, 2, 3, 4, 4, 7, 6, 9, 10, 12, 11, 19, 14, 20, 24, 27, 24, 37, 31, 44, 45, 49, 48, 71, 61, 72, 80, 92, 84, 118, 102, 128, 132, 144, 151, 191, 166, 197, 211, 244, 226, 287, 263, 313, 330, 348, 347, 435, 399, 462, 476, 524, 508, 614, 591, 674, 680, 732, 731, 890, 814, 916, 966, 1042, 1032, 1188, 1135, 1280, 1303
proposed
editing