cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

A247185 a(0) = 0. a(n) is the number of repeating sums in the collection of all sums of two elements in [a(0), ... a(n-1)], chosen without replacement.

Original entry on oeis.org

0, 0, 0, 2, 4, 6, 9, 11, 16, 19, 22, 26, 32, 38, 43, 50, 56, 67, 75, 81, 89, 97, 109, 119, 130, 140, 154, 166, 178, 194, 205, 220, 233, 250, 264, 283, 296, 312, 327, 345, 359, 378, 397, 415, 432, 456, 481, 504, 523, 547, 569, 591, 617, 641, 664, 689, 718, 744, 769, 797, 824, 847, 878, 910, 945
Offset: 0

Views

Author

Derek Orr, Nov 22 2014

Keywords

Comments

Without replacement means that a(i)+a(i) is not a valid sum to include. However, if a(i) = a(j), a(i)+a(j) is still a valid sum to include because they have different indices.
a(i)+a(j) and a(j)+a(i) are regarded as the same sum for all indices i and j.
a(n) <= A000217(n)-n.

Examples

			a(1) gives the number of repeating sums in the collection of all possible sums of two elements in [0]. There are no sums between two elements here, so a(1) = 0.
a(2) gives the number of repeating sums in the collection of all possible sums of two elements in [0,0]. There is only one sum, 0, thus there are no repeats. So a(2) = 0.
a(3) gives the number of repeating sums in the collection of all possible sums of two elements in [0,0,0]. The possible sums are 0+0, 0+0, or 0+0, thus there are two repeats. So a(3) = 2.
a(4) gives the number of repeating sums in the collection of all possible sums of two elements in [0,0,0,2]. The possible sums are 0+0, 0+0, 0+2, 0+0, 0+2, and 0+2. There are 4 repeating sums (2 extra zeros and 2 extra twos). So a(4) = 4.
		

Crossrefs

Cf. A247184.

Programs

  • PARI
    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,#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

Views

Author

Derek Orr, Nov 15 2020

Keywords

Comments

a(n) <= A000217(n)-n for n >= 1.
Without replacement means a(i)+a(i) is not included. However, if a(i)=a(j), a(i)+a(j) still counts because they have two different indices. If you include a(i)+a(i), the sequence becomes A000012 (all ones).
If you include the distinct sums between 3 elements and more, you arrive at the sequence 1, 0, followed by A000079 (2^n).
Same rule as in A247184, but with a(0)=1.

Examples

			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.
		

Crossrefs

Programs

  • Maple
    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
  • Mathematica
    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 *)
  • PARI
    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-2 of 2 results.