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.

A325679 Number of compositions of n such that every restriction to a circular subinterval has a different sum.

Original entry on oeis.org

1, 1, 1, 3, 3, 5, 5, 13, 13, 27, 21, 41, 41, 77, 63, 143, 129, 241, 203, 385, 347, 617, 491, 947, 835, 1445, 1185, 2511, 1991, 3585, 2915, 5411, 4569, 8063, 6321, 11131, 10133, 16465, 13207, 23817, 20133, 33929, 26663, 48357, 41363, 69605, 54363, 95727, 81183, 132257, 106581
Offset: 0

Views

Author

Gus Wiseman, May 13 2019

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.
A circular subinterval is a sequence of consecutive indices where the first and last indices are also considered consecutive.
For n > 0, a(n) is the number of subsets of Z_n which contain 0 and such that every ordered pair of distinct elements has a different difference (modulo n). The elements of a subset correspond with the partial sums of a composition. For example, when n = 8 the subset {0,2,7} corresponds with the composition (251). - Andrew Howroyd, Mar 24 2025

Examples

			The a(1) = 1 through a(8) = 13 compositions:
  (1)  (2)  (3)   (4)   (5)   (6)   (7)    (8)
            (12)  (13)  (14)  (15)  (16)   (17)
            (21)  (31)  (23)  (24)  (25)   (26)
                        (32)  (42)  (34)   (35)
                        (41)  (51)  (43)   (53)
                                    (52)   (62)
                                    (61)   (71)
                                    (124)  (125)
                                    (142)  (152)
                                    (214)  (215)
                                    (241)  (251)
                                    (412)  (512)
                                    (421)  (521)
		

Crossrefs

Programs

  • Mathematica
    suball[q_]:=Join[Take[q,#]&/@Select[Tuples[Range[Length[q]],2],OrderedQ],Drop[q,#]&/@Select[Tuples[Range[2,Length[q]-1],2],OrderedQ]];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],UnsameQ@@Total/@suball[#]&]],{n,0,15}]
  • PARI
    a(n)={
       my(recurse(k,b,w)=
          if(k >= n, 1,
             b+=1<Andrew Howroyd, Mar 24 2025

Extensions

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

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<
    				
Showing 1-2 of 2 results.