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.

A325878 Number of maximal subsets of {1..n} such that every orderless pair of distinct elements has a different sum.

Original entry on oeis.org

1, 1, 1, 1, 4, 5, 8, 22, 40, 56, 78, 124, 222, 390, 616, 892, 1220, 1620, 2182, 3042, 4392, 6364, 9054, 12608, 16980, 22244, 28482, 36208, 45864, 58692, 75804, 98440, 128694, 168250, 218558, 281210, 357594, 449402, 560034, 693332, 853546, 1050118, 1293458, 1596144, 1975394
Offset: 0

Views

Author

Gus Wiseman, Jun 02 2019

Keywords

Examples

			The a(1) = 1 through a(6) = 8 subsets:
  {1}  {1,2}  {1,2,3}  {1,2,3}  {1,2,4}    {1,2,3,5}
                       {1,2,4}  {2,3,4}    {1,2,3,6}
                       {1,3,4}  {2,4,5}    {1,2,4,6}
                       {2,3,4}  {1,2,3,5}  {1,3,4,5}
                                {1,3,4,5}  {1,3,5,6}
                                           {1,4,5,6}
                                           {2,3,4,6}
                                           {2,4,5,6}
		

Crossrefs

The subset case is A196723.
The integer partition case is A325857.
The strict integer partition case is A325877.
Heinz numbers of the counterexamples are given by A325991.

Programs

  • Mathematica
    fasmax[y_]:=Complement[y,Union@@(Most[Subsets[#]]&/@y)];
    Table[Length[fasmax[Select[Subsets[Range[n]],UnsameQ@@Plus@@@Subsets[Union[#],{2}]&]]],{n,0,10}]
  • PARI
    a(n)={
       my(ismaxl(b,w)=for(k=1, n, if(!bittest(b,k) && !bitand(w,b< n, ismaxl(b,w),
             my(s=self()(k+1, r, b, w));
             if(!bitand(w,b<Andrew Howroyd, Mar 23 2025

Extensions

a(21) onwards from Andrew Howroyd, Mar 23 2025

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

Original entry on oeis.org

1, 1, 1, 3, 2, 6, 14, 2, 10, 26, 60, 110, 4, 22, 68, 156, 320, 584, 8, 24, 80, 206, 504, 1004, 1910, 3380, 10, 34, 98, 282, 760, 1618, 3334, 6360, 11482, 2, 22, 70, 214, 540, 1250, 2718, 5712, 10910, 20418, 2, 12, 30, 90, 230, 562, 1228, 2690, 5550, 11260, 21164, 2, 4, 6, 10, 18
Offset: 0

Views

Author

Andrew Howroyd, Mar 23 2025

Keywords

Comments

Also the number of maximum sized subsets of {1..n} such that every pair of (not necessarily distinct) elements has a different sum. In other words, a(n) is the number of Sidon sets with A143824(n) elements which are <= n.

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(4) = 2 sets: {1,2,4}, {1,3,4}.
The a(5) = 6 sets: {1,2,4}, {1,2,5}, {1,3,4}, {1,4,5}, {2,3,5}, {2,4,5}.
The a(6) = 14 sets: {1,2,4}, {1,2,5}, {1,2,6}, {1,3,4}, {1,3,6}, {1,4,5}, {1,4,6}, {1,5,6}, {2,3,5}, {2,3,6}, {2,4,5}, {2,5,6}, {3,4,6}, {3,5,6}.
The a(7) = 2 sets: {1,2,5,7}, {1,3,6,7}.
		

Crossrefs

Cf. A143823, A143824 (maximum size of set), A325879, A377410, A382396, A382398.

Programs

  • PARI
    a(n)={
       local(best,count);
       my(recurse(k,r,b,w)=
          if(k > n, if(r>=best, if(r>best,best=r;count=0); count++),
             self()(k+1, r, b, w);
             b+=1<
    				
Showing 1-2 of 2 results.