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.

Original entry on oeis.org

1, 2, 4, 8, 15, 26, 48, 78, 133, 202, 316, 474, 755, 1054, 1604, 2196, 3305, 4370, 6208, 8228, 11631, 15086, 20912, 26842, 37581, 46626, 64052, 79984, 109635, 133314, 176156, 217094, 291409, 343872, 457828, 547576, 718375, 852074, 1112128, 1308230, 1714741
Offset: 0

Views

Author

Andrew Howroyd, Mar 27 2025

Keywords

Comments

Arithmetic is done modulo n.
Every subset of size at most 3 is included. The cake numbers A000125 give the number of such subsets.

Examples

			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.
		

Crossrefs

Programs

  • PARI
    a(n)={
       my(recurse(k,r,b,w)=
          if(k >= n, 1,
             my(t=bitand((1<