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.

This page as a plain text file.
%I A382398 #6 Mar 24 2025 15:15:17
%S A382398 1,1,1,1,4,2,8,22,2,14,40,102,214,4,24,92,236,564,1148,4,18,90,270,
%T A382398 694,1558,2,6,24,76,252,632,1554,3282,6820,12942,6,24,84,246,664,1562,
%U A382398 3442,7084,14336,27202,50520,2,26,88,294,704,1716,3708,8028,16108,31466,58320,107136,4,20,54
%N A382398 Number of maximum sized subsets of {1..n} such that every pair of distinct elements has a different sum.
%e A382398 The a(1) = 1 through a(6) = 8 subsets:
%e A382398   {1}  {1,2}  {1,2,3}  {1,2,3}  {1,2,3,5}  {1,2,3,5}
%e A382398                        {1,2,4}  {1,3,4,5}  {1,2,3,6}
%e A382398                        {1,3,4}             {1,2,4,6}
%e A382398                        {2,3,4}             {1,3,4,5}
%e A382398                                            {1,3,5,6}
%e A382398                                            {1,4,5,6}
%e A382398                                            {2,3,4,6}
%e A382398                                            {2,4,5,6}
%e A382398 Compare the above examples with A325878.
%o A382398 (PARI)
%o A382398 a(n)={
%o A382398    local(best,count);
%o A382398    my(recurse(k,r,b,w)=
%o A382398       if(k > n, if(r>=best, if(r>n,best=r;count=0); count++),
%o A382398          self()(k+1, r, b, w);
%o A382398          if(!bitand(w,b<<k), self()(k+1, r+1, b+(1<<k), w + (b<<k)));
%o A382398          )
%o A382398    );
%o A382398    recurse(1,0,0,0);
%o A382398    count;
%o A382398 }
%Y A382398 Cf. A039836 (maximum size), A196723, A325878, A382395.
%K A382398 nonn
%O A382398 0,5
%A A382398 _Andrew Howroyd_, Mar 23 2025