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.

A382398 Number of maximum sized subsets of {1..n} such that every pair of distinct elements has a different sum.

Original entry on oeis.org

1, 1, 1, 1, 4, 2, 8, 22, 2, 14, 40, 102, 214, 4, 24, 92, 236, 564, 1148, 4, 18, 90, 270, 694, 1558, 2, 6, 24, 76, 252, 632, 1554, 3282, 6820, 12942, 6, 24, 84, 246, 664, 1562, 3442, 7084, 14336, 27202, 50520, 2, 26, 88, 294, 704, 1716, 3708, 8028, 16108, 31466, 58320, 107136, 4, 20, 54
Offset: 0

Views

Author

Andrew Howroyd, Mar 23 2025

Keywords

Examples

			The a(1) = 1 through a(6) = 8 subsets:
  {1}  {1,2}  {1,2,3}  {1,2,3}  {1,2,3,5}  {1,2,3,5}
                       {1,2,4}  {1,3,4,5}  {1,2,3,6}
                       {1,3,4}             {1,2,4,6}
                       {2,3,4}             {1,3,4,5}
                                           {1,3,5,6}
                                           {1,4,5,6}
                                           {2,3,4,6}
                                           {2,4,5,6}
Compare the above examples with A325878.
		

Crossrefs

Cf. A039836 (maximum size), A196723, A325878, A382395.

Programs

  • PARI
    a(n)={
       local(best,count);
       my(recurse(k,r,b,w)=
          if(k > n, if(r>=best, if(r>n,best=r;count=0); count++),
             self()(k+1, r, b, w);
             if(!bitand(w,b<