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.

A382400 Number of subsets of Z_n such that every ordered pair of distinct elements has a different sum.

This page as a plain text file.
%I A382400 #6 Mar 27 2025 18:33:24
%S A382400 1,2,4,8,15,26,48,78,133,202,316,474,755,1054,1604,2196,3305,4370,
%T A382400 6208,8228,11631,15086,20912,26842,37581,46626,64052,79984,109635,
%U A382400 133314,176156,217094,291409,343872,457828,547576,718375,852074,1112128,1308230,1714741
%N A382400 Number of subsets of Z_n such that every ordered pair of distinct elements has a different sum.
%C A382400 Arithmetic is done modulo n.
%C A382400 Every subset of size at most 3 is included. The cake numbers A000125 give the number of such subsets.
%H A382400 Andrew Howroyd, <a href="/A382400/b382400.txt">Table of n, a(n) for n = 0..50</a>
%e A382400 The a(6) = 48 subsets are 42 subsets of size at most 3 and the following 6: {1,3,4,5}, {1,2,3,5}, {0,2,4,5}, {0,2,3,4}, {0,1,3,5}, {0,1,2,4}. Each of the size 4 subsets is perfect in the sense that every number from 0..5 can be written as the sum of two elements modulo 6 in exactly one way.
%o A382400 (PARI)
%o A382400 a(n)={
%o A382400    my(recurse(k,r,b,w)=
%o A382400       if(k >= n, 1,
%o A382400          my(t=bitand((1<<n)-1, bitor(b<<k, b<<(k-n))));
%o A382400          self()(k+1, r, b, w) +
%o A382400             if(!bitand(w,t), self()(k+1, r+1, b+(1<<k), w + t));
%o A382400        ));
%o A382400    recurse(0,0,0,0);
%o A382400 }
%Y A382400 Cf. A000125, A196723, A382399.
%K A382400 nonn
%O A382400 0,2
%A A382400 _Andrew Howroyd_, Mar 27 2025