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-3 of 3 results.

A377410 Maximum sum of a subset of {1..n} such that every pair of distinct elements has a different difference.

Original entry on oeis.org

0, 1, 3, 5, 8, 11, 14, 17, 21, 25, 29, 33, 37, 42, 47, 52, 57, 62, 67, 72, 78, 84, 90, 96, 102, 108, 114, 120, 126, 132, 138, 144, 151, 158, 165, 172, 179, 186, 193, 200, 207, 215, 223, 231, 239, 247, 255, 263, 271, 279, 287, 295, 303, 311, 319, 327, 335, 343, 351, 360, 369
Offset: 0

Views

Author

Andrew Howroyd, Oct 27 2024

Keywords

Comments

Also the maximum sum of a subset of {1..n} such that every unordered pair of (not necessarily distinct) elements has a different sum. In other words, a(n) is the maximum sum of a Sidon set whose elements are <= n.

Examples

			a(0) = 0 = sum of {}.
a(1) = 1 = sum of {1}.
a(2) = 3 = sum of {1,2}.
a(3) = 5 = sum of {2,3}.
a(4) = 8 = sum of {1,3,4}.
a(5) = 11 = sum of {2,4,5}.
a(12) = 37 = sum of {6,8,11,12} or {5,9,11,12}.
a(20) = 78 = sum of {2,8,12,17,19,20}.
See also the examples in A143823.
		

Crossrefs

Cf. A143823, A143824 (maximum size of set), A377419.

Programs

  • PARI
    a(n)={
       my(recurse(k,b,w)=
          if(k > n, 0,
             my(s=self()(k+1, b, w));
             b+=1<
    				
  • Python
    def a(n):
        def recurse(k, b, w):
            if k > n: return 0
            s = recurse(k+1, b, w)
            b += (1<Michael S. Branicky, Oct 27 2024 after Andrew Howroyd

Extensions

Name edited by Andrew Howroyd, Mar 24 2025

A382396 Number of minimum sized maximal subsets of {1..n} such that every pair of distinct elements has a different difference.

Original entry on oeis.org

1, 1, 1, 3, 1, 6, 14, 18, 14, 10, 4, 110, 172, 216, 226, 214, 184, 152, 116, 82, 50, 26, 10, 3696, 3904, 3942, 3768, 3504, 3016, 2548, 2060, 1598, 1170, 832, 538, 330, 196, 106, 52, 20, 10, 4, 2, 69610, 62594, 55294, 47610, 40502, 33538, 27254, 21544, 16764, 12676, 9258, 6534, 4516, 3042, 1990, 1254, 754, 448
Offset: 0

Views

Author

Andrew Howroyd, Mar 23 2025

Keywords

Comments

Also the number of minimum sized maximal subsets of {1..n} such that every pair of (not necessarily distinct) elements has a different sum.

Examples

			The a(0) = 1 set is {}.
The a(1) = 1 set is {1}.
The a(2) = 1 set is {1,2}.
The a(3) = 3 sets: {1,2}, {1,3}, {2,3}.
The a(11) = 4 sets: {1,2,4,8}, {1,2,4,9}, {1,2,4,10}, {1,2,4,11}.
The a(42) = 2 sets: {10,18,19,25,30}, {13,18,24,25,33}.
See also the examples in A325879.
		

Crossrefs

Cf. A143823, A325879, A377419, A382395, A382397 (minimum size of set).

Programs

  • PARI
    a(n)={
      local(best,count); best=n+1;
      my(ismaxl(b,w)=for(k=1, n, if(!bittest(b,k) && !bitand(w,bitor(b,1< n, if(ismaxl(b,w),if(r
    				

A382397 Minimum size of a maximal subset of {1..n} such that every pair of distinct elements has a different difference.

Original entry on oeis.org

0, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6
Offset: 0

Views

Author

Andrew Howroyd, Mar 23 2025

Keywords

Comments

Also the minimum size of a maximal subset of {1..n} such that every pair of (not necessarily distinct) elements has a different sum.
a(n) is the minimum size of a set enumerated by A325879(n).
Number of occurrences of k: 1, 1, 3, 6, 12, 20, ...
Maximum n having a(n) = k: 0, 1, 4, 10, 22, 42, ...
There are insufficient known terms in either of the above to distinguish from other sequences.

Crossrefs

Cf. A143824 (maximum size of set), A325879, A377419 (minimum sum), A382396.

Programs

  • PARI
    a(n)={
      my(ismaxl(b,w)=for(k=1, n, if(!bittest(b,k) && !bitand(w,bitor(b,1< n, if(ismaxl(b,w),0,n+1),
             my(s=self()(k+1, b,w));
             b+=1<
    				
Showing 1-3 of 3 results.