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-4 of 4 results.

A325683 Number of maximal Golomb rulers of length n.

Original entry on oeis.org

1, 1, 1, 2, 2, 4, 2, 6, 8, 18, 16, 24, 20, 28, 42, 76, 100, 138, 168, 204, 194, 272, 276, 450, 588, 808, 992, 1578, 1612, 1998, 2166, 2680, 2732, 3834, 3910, 5716, 6818, 9450, 10524, 15504, 16640, 22268, 23754, 30430, 31498, 40644, 40294, 52442, 56344, 72972, 77184
Offset: 0

Views

Author

Gus Wiseman, May 13 2019

Keywords

Comments

A Golomb ruler of length n is a subset of {0..n} containing 0 and n and such that every pair of distinct terms has a different difference up to sign.
Also the number of minimal (most refined) compositions of n such that every restriction to a subinterval has a different sum.

Examples

			The a(1) = 1 through a(8) = 8 maximal Golomb rulers:
  {0,1}  {0,2}  {0,1,3}  {0,1,4}  {0,1,5}  {0,1,4,6}  {0,1,3,7}  {0,1,3,8}
                {0,2,3}  {0,3,4}  {0,2,5}  {0,2,5,6}  {0,1,5,7}  {0,1,5,8}
                                  {0,3,5}             {0,2,3,7}  {0,1,6,8}
                                  {0,4,5}             {0,2,6,7}  {0,2,3,8}
                                                      {0,4,5,7}  {0,2,7,8}
                                                      {0,4,6,7}  {0,3,7,8}
                                                                 {0,5,6,8}
                                                                 {0,5,7,8}
The a(1) = 1 through a(10) = 16 minimal compositions:
  (1)  (2)  (12)  (13)  (14)  (132)  (124)  (125)  (126)  (127)
            (21)  (31)  (23)  (231)  (142)  (143)  (135)  (136)
                        (32)         (214)  (152)  (153)  (154)
                        (41)         (241)  (215)  (162)  (163)
                                     (412)  (251)  (216)  (172)
                                     (421)  (341)  (234)  (217)
                                            (512)  (243)  (253)
                                            (521)  (261)  (271)
                                                   (315)  (316)
                                                   (324)  (352)
                                                   (342)  (361)
                                                   (351)  (451)
                                                   (423)  (613)
                                                   (432)  (631)
                                                   (513)  (712)
                                                   (531)  (721)
                                                   (612)
                                                   (621)
		

Crossrefs

Programs

  • Mathematica
    fasmax[y_]:=Complement[y,Union@@(Most[Subsets[#]]&/@y)];
    Table[Length[fasmax[Accumulate/@Select[Join@@Permutations/@IntegerPartitions[n],UnsameQ@@ReplaceList[#,{_,s__,_}:>Plus[s]]&]]],{n,0,15}]

Extensions

a(21)-a(50) from Fausto A. C. Cariboni, Feb 22 2022

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

A325678 Maximum length of a composition of n such that every restriction to a subinterval has a different sum.

Original entry on oeis.org

0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10
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.
Also the maximum number of nonzero marks on a Golomb ruler of length n.

Crossrefs

Programs

  • Mathematica
    Table[Max[Length/@Select[Join@@Permutations/@IntegerPartitions[n],UnsameQ@@ReplaceList[#,{_,s__,_}:>Plus[s]]&]],{n,0,15}]

Formula

a(n) + 1 = A143824(n + 1).

A382399 Number of subsets of Z_n such that every ordered pair of distinct elements has a different difference.

Original entry on oeis.org

1, 2, 3, 7, 9, 16, 19, 43, 49, 100, 91, 177, 193, 352, 323, 691, 673, 1242, 1135, 2129, 2041, 3634, 3103, 5843, 5473, 9326, 8139, 16579, 14001, 24796, 21271, 38813, 34369, 60292, 49539, 86451, 81361, 131684, 110391, 196717, 171761, 286878, 236167, 419337, 370569, 618346, 501999, 872415, 763777, 1235438, 1028451
Offset: 0

Views

Author

Andrew Howroyd, Mar 24 2025

Keywords

Comments

Arithmetic is done modulo n.
Also the number of subsets of Z_n such that every unordered pair of (not necessarily distinct) elements has a different sum.

Examples

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

Crossrefs

Programs

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

Formula

a(n) = n*A325681(n) + 1.
Showing 1-4 of 4 results.