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.

A003022 Length of shortest (or optimal) Golomb ruler with n marks.

Original entry on oeis.org

1, 3, 6, 11, 17, 25, 34, 44, 55, 72, 85, 106, 127, 151, 177, 199, 216, 246, 283, 333, 356, 372, 425, 480, 492, 553, 585
Offset: 2

Views

Author

Keywords

Comments

a(n) is the least integer such that there is an n-element set of integers between 0 and a(n), the sums of pairs (of not necessarily distinct elements) of which are distinct.
From David W. Wilson, Aug 17 2007: (Start)
An n-mark Golomb ruler has a unique integer distance between any pair of marks and thus measures n(n-1)/2 distinct integer distances.
An optimal n-mark Golomb ruler has the smallest possible length (distance between the two end marks) for an n-mark ruler.
A perfect n-mark Golomb ruler has length exactly n(n-1)/2 and measures each distance from 1 to n(n-1)/2. (End)
Positions where A143824 increases (see also A227590). - N. J. A. Sloane, Apr 08 2016
From Gus Wiseman, May 17 2019: (Start)
Also the smallest m such that there exists a length-n composition of m for which every restriction to a subinterval has a different sum. Representatives of compositions for the first few terms are:
0: ()
1: (1)
3: (2,1)
6: (2,3,1)
11: (3,1,5,2)
17: (4,2,3,7,1)
Representatives of corresponding Golomb rulers are:
{0}
{0,1}
{0,2,3}
{0,2,5,6}
{0,3,4,9,11}
{0,4,6,9,16,17}
(End)

Examples

			a(5)=11 because 0-1-4-9-11 (0-2-7-10-11) resp. 0-3-4-9-11 (0-2-7-8-11) are shortest: there is no b0-b1-b2-b3-b4 with different distances |bi-bj| and max. |bi-bj| < 11.
		

References

  • CRC Handbook of Combinatorial Designs, 1996, p. 315.
  • A. K. Dewdney, Computer Recreations, Scientific Amer. 253 (No. 6, Jun), 1985, pp. 16ff; 254 (No. 3, March), 1986, pp. 20ff.
  • S. W. Golomb, How to number a graph, pp. 23-37 of R. C. Read, editor, Graph Theory and Computing. Academic Press, NY, 1972.
  • Richard K. Guy, Unsolved Problems in Number Theory (2nd edition), Springer-Verlag (1994), Section C10.
  • A. Kotzig and P. J. Laufer, Sum triangles of natural numbers having minimum top, Ars. Combin. 21 (1986), 5-13.
  • Miller, J. C. P., Difference bases. Three problems in additive number theory. Computers in number theory (Proc. Sci. Res. Council Atlas Sympos. No. 2, Oxford, 1969), pp. 299--322. Academic Press, London,1971. MR0316269 (47 #4817)
  • Rhys Price Jones, Gracelessness, Proc. 10th S.-E. Conf. Combin., Graph Theory and Computing, 1979, pp. 547-552.
  • Ana Salagean, David Gardner and Raphael Phan, Index Tables of Finite Fields and Modular Golomb Rulers, in Sequences and Their Applications - SETA 2012, Lecture Notes in Computer Science. Volume 7280, 2012, pp. 136-147.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

See A106683 for triangle of marks.
0-1-4-9-11 corresponds to 1-3-5-2 in A039953: 0+1+3+5+2=11
A row or column of array in A234943.
Adding 1 to these terms gives A227590. Cf. A143824.
For first differences see A270813.

Programs

  • Mathematica
    Min@@Total/@#&/@GatherBy[Select[Join@@Permutations/@Join@@Table[IntegerPartitions[i],{i,0,15}],UnsameQ@@ReplaceList[#,{_,s__,_}:>Plus[s]]&],Length] (* Gus Wiseman, May 17 2019 *)
  • Python
    from itertools import combinations, combinations_with_replacement, count
    def a(n):
        for k in count(n-1):
            for c in combinations(range(k), n-1):
                c = c + (k, )
                ss = set()
                for s in combinations_with_replacement(c, 2):
                    if sum(s) in ss: break
                    else: ss.add(sum(s))
                if len(ss) == n*(n+1)//2: return k # Jianing Song, Feb 14 2025, adapted from the python program of A345731

Formula

a(n) >= n(n-1)/2, with strict inequality for n >= 5 (Golomb). - David W. Wilson, Aug 18 2007

Extensions

425 sent by Ed Pegg Jr, Nov 15 2004
a(25), a(26) proved by OGR-25 and OGR-26 projects, added by Max Alekseyev, Sep 29 2010
a(27) proved by OGR-27, added by David Consiglio, Jr., Jun 09 2014
a(28) proved by OGR-28, added by David Consiglio, Jr., Jan 19 2023

A143824 Size of the largest subset {x(1),x(2),...,x(k)} of {1,2,...,n} with the property that all differences |x(i)-x(j)| are distinct.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12
Offset: 0

Views

Author

John W. Layman, Sep 02 2008

Keywords

Comments

When the set {x(1),x(2),...,x(k)} satisfies the property that all differences |x(i)-x(j)| are distinct (or alternately, all the sums are distinct), then it is called a Sidon set. So a(n) is the maximum cardinality of a dense Sidon subset of {1,2,...,n}. - Sayan Dutta, Aug 29 2024
See A143823 for the number of subsets of {1, 2, ..., n} with the required property.
See A003022 (and A227590) for the values of n such that a(n+1) > a(n). - Boris Bukh, Jul 28 2013
Can be formulated as an integer linear program: maximize sum {i = 1 to n} z[i] subject to z[i] + z[j] - 1 <= y[i,j] for all i < j, sum {i = 1 to n - d} y[i,i+d] <= 1 for d = 1 to n - 1, z[i] in {0,1} for all i, y[i,j] in {0,1} for all i < j. - Rob Pratt, Feb 09 2010
If the zeroth term is removed, the run-lengths are A270813 with 1 prepended. - Gus Wiseman, Jun 07 2019

Examples

			For n = 4, {1, 2, 4} is a subset of {1, 2, 3, 4} with distinct differences 2 - 1 = 1, 4 - 1 = 3, 4 - 2 = 2 between pairs of elements and no larger set has the required property; so a(4) = 3.
From _Gus Wiseman_, Jun 07 2019: (Start)
Examples of subsets realizing each largest size are:
   0: {}
   1: {1}
   2: {1,2}
   3: {2,3}
   4: {1,3,4}
   5: {2,4,5}
   6: {3,5,6}
   7: {1,3,6,7}
   8: {2,4,7,8}
   9: {3,5,8,9}
  10: {4,6,9,10}
  11: {5,7,10,11}
  12: {1,4,5,10,12}
  13: {2,5,6,11,13}
  14: {3,6,7,12,14}
  15: {4,7,8,13,15}
(End)
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Last[Select[Subsets[Range[n]],UnsameQ@@Subtract@@@Subsets[#,{2}]&]]],{n,0,15}] (* Gus Wiseman, Jun 07 2019 *)

Formula

For n > 1, a(n) = A325678(n - 1) + 1. - Gus Wiseman, Jun 07 2019
From Sayan Dutta, Aug 29 2024: (Start)
a(n) < n^(1/2) + 0.998*n^(1/4) for sufficiently large n (see Balogh et. al. link).
It is conjectured by Erdos (for $500) that a(n) < n^(1/2) + o(n^e) for all e>0. (End)

Extensions

More terms from Rob Pratt, Feb 09 2010
a(41)-a(60) from Alois P. Heinz, Sep 14 2011
More terms and b-file from N. J. A. Sloane, Apr 08 2016 using data from A003022.

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).

A036501 Number of inequivalent Golomb rulers with n marks and shortest length.

Original entry on oeis.org

1, 1, 1, 2, 4, 5, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 2

Views

Author

Keywords

Comments

From Gus Wiseman, May 31 2019: (Start)
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. For example, the a(2) = 1 through a(8) = 1 Golomb rulers are:
2: {0,1}
3: {0,1,3}
4: {0,1,4,6}
5: {0,1,4,9,11}
5: {0,2,7,8,11}
6: {0,1,4,10,12,17}
6: {0,1,4,10,15,17}
6: {0,1,8,11,13,17}
6: {0,1,8,12,14,17}
7: {0,1,4,10,18,23,25}
7: {0,1,7,11,20,23,25}
7: {0,2,3,10,16,21,25}
7: {0,2,7,13,21,22,25}
7: {0,1,11,16,19,23,25}
8: {0,1,4,9,15,22,32,34}
Also half the number of length-(n - 1) compositions of A003022(n) such that every consecutive subsequence has a different sum. For example, the a(2) = 1 through a(8) = 1 compositions are (A = 10):
2: (1)
3: (1,2)
4: (1,3,2)
5: (1,3,5,2)
5: (2,5,1,3)
6: (1,3,6,2,5)
6: (1,3,6,5,2)
6: (1,7,3,2,4)
6: (1,7,4,2,3)
7: (1,3,6,8,5,2)
7: (1,6,4,9,3,2)
7: (2,1,7,6,5,4)
7: (2,5,6,8,1,3)
7: (1,A,5,3,4,2)
8: (1,3,5,6,7,A,2)
(End)

Crossrefs

Showing 1-4 of 4 results.