A247184
a(0) = 0. a(n) is the number of distinct sums of two elements in [a(0), ... a(n-1)] chosen without replacement.
Original entry on oeis.org
0, 0, 1, 2, 4, 7, 11, 15, 20, 26, 32, 40, 48, 57, 65, 73, 81, 90, 98, 106, 114, 123, 132, 147, 157, 170, 190, 202, 223, 236, 251, 270, 291, 314, 338, 361, 380, 398, 421, 443, 471, 495, 520, 544, 567, 592, 616, 639, 663, 692, 720, 749, 781, 819, 852, 885, 913, 948, 987, 1023, 1055, 1088
Offset: 0
a(1) gives the number of distinct sums of two elements of [0]. There aren't two elements so a(1) = 0.
a(2) gives the number of distinct sums of two elements of [0,0]. There is only 1 sum, 0, so a(2) = 1.
a(3) gives the number of distinct sums of two elements of [0,0,1]. There are 2 distinct possible sums 0 and 1, so a(3) = 2.
a(4) gives the number of distinct sums of two elements of [0,0,1,2]. There are 4 distinct possible sums {0, 1, 2, 3}, so a(4) = 4.
-
s:= proc(n) option remember; `if`(n=0, {},
{s(n-1)[], seq(a(i)+a(n), i=0..n-1)})
end:
a:= proc(n) option remember;
`if`(n=0, 0, nops(s(n-1)))
end:
seq(a(n), n=0..50); # Alois P. Heinz, Nov 16 2020
-
s[n_] := s[n] = If[n == 0, {},
Union@Join[s[n-1], Table[a[i] + a[n], {i, 0, n-1}]]];
a[n_] := a[n] =
If[n == 0, 0, Length[s[n-1]]];
Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Jul 16 2021, after Alois P. Heinz *)
-
v=[0];n=1;while(n<75,w=[];for(i=1,#v,for(j=i+1,#v,w=concat(w,v[i]+v[j])));v=concat(v,#vecsort(w,,8));n++);v
A247186
a(0) = 0. a(n) is the number of repeating sums in the collection of all sums formed from [a(0), ... a(n-1)] + [a(0), ... a(n-1)].
Original entry on oeis.org
0, 0, 2, 3, 4, 7, 9, 12, 16, 20, 25, 31, 34, 42, 48, 53, 62, 71, 79, 88, 98, 105, 116, 128, 136, 146, 157, 169, 182, 195, 210, 228, 245, 259, 272, 289, 306, 322, 343, 362, 376, 395, 412, 436, 454, 478, 493, 509, 530, 555, 578, 602, 631, 652, 678, 708, 732, 759, 783, 808, 837, 870, 895
Offset: 0
a(1) is the number of repeating sums in the collection of all possible sums of [0] + [0]. There is only one possible sum here, 0+0. There are no repeats, so a(1) = 0.
a(2) is the number of repeating sums in the collection of all possible sums of [0,0] + [0,0]. The possible sums are 0+0, 0+0, and 0+0 (first+first, first+second, and second+second). There are two repeats, so a(2) = 2.
a(3) is the number of repeating sums in the collection of all possible sums of [0,0,2] + [0,0,2]. The possible sums are 0+0, 0+0, 0+2, 0+0, 0+2, and 2+2. There are 3 repeats, so a(3) = 3.
a(4) is the number of repeating sums in the collection of all possible sums of [0,0,2,3] + [0,0,2,3]. The possible sums are 0+0, 0+0, 0+2, 0+3, 0+0, 0+2, 0+3, 2+2, 2+3, and 3+3. There are 4 repeats, so a(4) = 4.
-
v=[0];n=1;while(n<75,w=[];for(i=1,#v,for(j=i,#v,w=concat(w,v[i]+v[j])));v=concat(v,#w-#vecsort(w,,8));n++);v
A338921
a(0)=1, a(n) for n >= 1 is the number of distinct sums of two elements in [a(0), ..., a(n-1)], chosen without replacement.
Original entry on oeis.org
1, 0, 1, 2, 3, 5, 8, 12, 17, 22, 28, 35, 43, 52, 60, 69, 77, 86, 92, 103, 112, 123, 137, 151, 168, 180, 194, 204, 224, 245, 261, 280, 301, 318, 335, 352, 369, 387, 413, 433, 459, 482, 507, 528, 552, 586, 614, 638, 669, 701, 733, 761, 791, 824, 855, 885, 917, 952, 985, 1020
Offset: 0
a(1) gives the number of distinct sums between two elements of [1]. There aren't two elements so a(1)=0.
a(2) gives the number of distinct sums between two elements of [1,0]. The only sum are 1+0, so a(2) = 1.
a(3) gives the number of distinct sums between two elements of [1,0,1]. The two sums are 1+0 and 1+1 so a(3)=2.
-
s:= proc(n) option remember; `if`(n=0, {},
{s(n-1)[], seq(a(i)+a(n), i=0..n-1)})
end:
a:= proc(n) option remember;
`if`(n=0, 1, nops(s(n-1)))
end:
seq(a(n), n=0..60); # Alois P. Heinz, Nov 16 2020
-
a[0] = 1; a[1] = 0;
a[n_Integer?Positive] := a[n] = Length[Union[Total[Subsets[Array[a, n, 0], {2}], {2}]]];
Array[a, 61, 0] (* Jan Mangaldan, Nov 23 2020 *)
-
my(v=[1], w=[], n=1); while(n<75, for(i=2, #v, w=concat(w,v[i-1]+v[#v])); w=vecsort(w,,8); v=concat(v, #w); n++); v
Showing 1-3 of 3 results.
Comments