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-10 of 48 results. Next

A143823 Number of subsets {x(1),x(2),...,x(k)} of {1,2,...,n} such that all differences |x(i)-x(j)| are distinct.

Original entry on oeis.org

1, 2, 4, 7, 13, 22, 36, 57, 91, 140, 216, 317, 463, 668, 962, 1359, 1919, 2666, 3694, 5035, 6845, 9188, 12366, 16417, 21787, 28708, 37722, 49083, 63921, 82640, 106722, 136675, 174895, 222558, 283108, 357727, 451575, 567536, 712856, 890405, 1112081, 1382416, 1717540
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 this sequence is basically the number of Sidon subsets of {1,2,...,n}. - Sayan Dutta, Feb 15 2024
See A143824 for sizes of the largest subsets of {1,2,...,n} with the desired property.
Also the number of subsets of {1..n} such that every orderless pair of (not necessarily distinct) elements has a different sum. - Gus Wiseman, Jun 07 2019

Examples

			{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, so {1,2,4} is counted as one of the 13 subsets of {1,2,3,4} with the desired property.  Only 2^4-13=3 subsets of {1,2,3,4} do not have this property: {1,2,3}, {2,3,4}, {1,2,3,4}.
From _Gus Wiseman_, May 17 2019: (Start)
The a(0) = 1 through a(5) = 22 subsets:
  {}  {}   {}     {}     {}       {}
      {1}  {1}    {1}    {1}      {1}
           {2}    {2}    {2}      {2}
           {1,2}  {3}    {3}      {3}
                  {1,2}  {4}      {4}
                  {1,3}  {1,2}    {5}
                  {2,3}  {1,3}    {1,2}
                         {1,4}    {1,3}
                         {2,3}    {1,4}
                         {2,4}    {1,5}
                         {3,4}    {2,3}
                         {1,2,4}  {2,4}
                         {1,3,4}  {2,5}
                                  {3,4}
                                  {3,5}
                                  {4,5}
                                  {1,2,4}
                                  {1,2,5}
                                  {1,3,4}
                                  {1,4,5}
                                  {2,3,5}
                                  {2,4,5}
(End)
		

Crossrefs

First differences are A308251.
Second differences are A169942.
Row sums of A381476.
The maximal case is A325879.
The integer partition case is A325858.
The strict integer partition case is A325876.
Heinz numbers of the counterexamples are given by A325992.

Programs

  • Maple
    b:= proc(n, s) local sn, m;
          if n<1 then 1
        else sn:= [s[], n];
             m:= nops(sn);
             `if`(m*(m-1)/2 = nops(({seq(seq(sn[i]-sn[j],
               j=i+1..m), i=1..m-1)})), b(n-1, sn), 0) +b(n-1, s)
          fi
        end:
    a:= proc(n) option remember;
           b(n-1, [n]) +`if`(n=0, 0, a(n-1))
        end:
    seq(a(n), n=0..30);  # Alois P. Heinz, Sep 14 2011
  • Mathematica
    b[n_, s_] := Module[{ sn, m}, If[n<1, 1, sn = Append[s, n]; m = Length[sn]; If[m*(m-1)/2 == Length[Table[sn[[i]] - sn[[j]], {i, 1, m-1}, {j, i+1, m}] // Flatten // Union], b[n-1, sn], 0] + b[n-1, s]]]; a[n_] := a[n] = b[n - 1, {n}] + If[n == 0, 0, a[n-1]]; Table [a[n], {n, 0, 30}] (* Jean-François Alcover, Nov 08 2015, after Alois P. Heinz *)
    Table[Length[Select[Subsets[Range[n]],UnsameQ@@Abs[Subtract@@@Subsets[#,{2}]]&]],{n,0,15}] (* Gus Wiseman, May 17 2019 *)
  • Python
    from itertools import combinations
    def is_sidon_set(s):
        allsums = []
        for i in range(len(s)):
            for j in range(i, len(s)):
                allsums.append(s[i] + s[j])
        if len(allsums)==len(set(allsums)):
            return True
        return False
    def a(n):
        sidon_count = 0
        for r in range(n + 1):
            subsets = combinations(range(1, n + 1), r)
            for subset in subsets:
                if is_sidon_set(subset):
                    sidon_count += 1
        return sidon_count
    print([a(n) for n in range(20)]) # Sayan Dutta, Feb 15 2024
    
  • Python
    from functools import cache
    def b(n, s):
        if n < 1: return 1
        sn = s + [n]
        m = len(sn)
        return (b(n-1, sn) if m*(m-1)//2 == len(set(sn[i]-sn[j] for i in range(m-1) for j in range(i+1, m))) else 0) + b(n-1, s)
    @cache
    def a(n): return b(n-1, [n]) + (0 if n==0 else a(n-1))
    print([a(n) for n in range(31)]) # Michael S. Branicky, Feb 15 2024 after Alois P. Heinz

Formula

a(n) = A169947(n-1) + n + 1 for n>=2. - Nathaniel Johnston, Nov 12 2010
a(n) = A054578(n) + 1 for n>0. - Alois P. Heinz, Jan 17 2013

Extensions

a(21)-a(29) from Nathaniel Johnston, Nov 12 2010
Corrected a(21)-a(29) and more terms from Alois P. Heinz, Sep 14 2011

A325676 Number of compositions of n such that every distinct consecutive subsequence has a different sum.

Original entry on oeis.org

1, 1, 2, 4, 5, 10, 12, 24, 26, 47, 50, 96, 104, 172, 188, 322, 335, 552, 590, 938, 1002, 1612, 1648, 2586, 2862, 4131, 4418, 6718, 7122, 10332, 11166, 15930, 17446, 24834, 26166, 37146, 41087, 55732, 59592, 84068, 89740, 122106, 133070, 177876, 194024, 262840, 278626
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.
Compare to the definition of knapsack partitions (A108917).

Examples

			The distinct consecutive subsequences of (1,4,4,3) together with their sums are:
   1: {1}
   3: {3}
   4: {4}
   5: {1,4}
   7: {4,3}
   8: {4,4}
   9: {1,4,4}
  11: {4,4,3}
  12: {1,4,4,3}
Because the sums are all different, (1,4,4,3) is counted under a(12).
The a(1) = 1 through a(6) = 12 compositions:
  (1)  (2)   (3)    (4)     (5)      (6)
       (11)  (12)   (13)    (14)     (15)
             (21)   (22)    (23)     (24)
             (111)  (31)    (32)     (33)
                    (1111)  (41)     (42)
                            (113)    (51)
                            (122)    (114)
                            (221)    (132)
                            (311)    (222)
                            (11111)  (231)
                                     (411)
                                     (111111)
		

Crossrefs

Programs

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

Extensions

a(21)-a(22) from Jinyuan Wang, Jun 20 2020
a(23)-a(25) from Robert Price, Jun 19 2021
a(26)-a(46) from Fausto A. C. Cariboni, Feb 10 2022

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

A103295 Number of complete rulers with length n.

Original entry on oeis.org

1, 1, 1, 3, 4, 9, 17, 33, 63, 128, 248, 495, 988, 1969, 3911, 7857, 15635, 31304, 62732, 125501, 250793, 503203, 1006339, 2014992, 4035985, 8080448, 16169267, 32397761, 64826967, 129774838, 259822143, 520063531, 1040616486, 2083345793, 4168640894, 8342197304, 16694070805, 33404706520, 66832674546, 133736345590
Offset: 0

Views

Author

Peter Luschny, Feb 28 2005

Keywords

Comments

For definitions, references and links related to complete rulers see A103294.
Also the number of compositions of n whose consecutive subsequence-sums cover an initial interval of the positive integers. For example, (2,3,1) is such a composition because (1), (2), (3), (3,1), (2,3), and (2,3,1) are subsequences with sums covering {1..6}. - Gus Wiseman, May 17 2019
a(n) ~ c*2^n, where 0.2427 < c < 0.2459. - Fei Peng, Oct 17 2019

Examples

			a(4) = 4 counts the complete rulers with length 4, {[0,2,3,4],[0,1,3,4],[0,1,2,4],[0,1,2,3,4]}.
		

Crossrefs

Cf. A103300 (Perfect rulers with length n). Main diagonal of A349976.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],SubsetQ[ReplaceList[#,{_,s__,_}:>Plus[s]],Range[n]]&]],{n,0,15}] (* Gus Wiseman, May 17 2019 *)

Formula

a(n) = Sum_{i=0..n} A103294(n, i) = Sum_{i=A103298(n)..n} A103294(n, i).

Extensions

a(30)-a(36) from Hugo Pfoertner, Mar 17 2005
a(37)-a(38) from Hugo Pfoertner, Dec 10 2021
a(39) from Hugo Pfoertner, Dec 16 2021

A333224 Number of distinct positive consecutive subsequence-sums of the k-th composition in standard order.

Original entry on oeis.org

0, 1, 1, 2, 1, 3, 3, 3, 1, 3, 2, 4, 3, 4, 4, 4, 1, 3, 3, 5, 3, 5, 4, 5, 3, 4, 5, 5, 5, 5, 5, 5, 1, 3, 3, 5, 2, 5, 5, 6, 3, 6, 3, 6, 5, 6, 5, 6, 3, 4, 6, 6, 5, 6, 6, 6, 5, 6, 6, 6, 6, 6, 6, 6, 1, 3, 3, 5, 3, 6, 6, 7, 3, 5, 5, 7, 4, 6, 6, 7, 3, 6, 4, 7, 5, 7, 6
Offset: 0

Views

Author

Gus Wiseman, Mar 18 2020

Keywords

Comments

The k-th composition in standard order (row k of A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again.

Examples

			The composition (4,3,1,2) has positive subsequence-sums 1, 2, 3, 4, 6, 7, 8, 10, so a(550) = 8.
		

Crossrefs

Dominated by A124770.
Compositions where every subinterval has a different sum are counted by A169942 and A325677 and ranked by A333222. The case of partitions is counted by A325768 and ranked by A325779.
Positive subset-sums of partitions are counted by A276024 and A299701.
Knapsack partitions are counted by A108917 and A325592 and ranked by A299702.
Strict knapsack partitions are counted by A275972 and ranked by A059519 and A301899.
Knapsack compositions are counted by A325676 and A325687 and ranked by A333223. The case of partitions is counted by A325769 and ranked by A325778, for which the number of distinct consecutive subsequences is given by A325770.
Allowing empty subsequences gives A333257.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Length[Union[ReplaceList[stc[n],{_,s__,_}:>Plus[s]]]],{n,0,100}]

Formula

a(n) = A333257(n) - 1.

A333257 Number of distinct consecutive subsequence-sums of the k-th composition in standard order.

Original entry on oeis.org

1, 2, 2, 3, 2, 4, 4, 4, 2, 4, 3, 5, 4, 5, 5, 5, 2, 4, 4, 6, 4, 6, 5, 6, 4, 5, 6, 6, 6, 6, 6, 6, 2, 4, 4, 6, 3, 6, 6, 7, 4, 7, 4, 7, 6, 7, 6, 7, 4, 5, 7, 7, 6, 7, 7, 7, 6, 7, 7, 7, 7, 7, 7, 7, 2, 4, 4, 6, 4, 7, 7, 8, 4, 6, 6, 8, 5, 7, 7, 8, 4, 7, 5, 8, 6, 8, 7
Offset: 0

Views

Author

Gus Wiseman, Mar 20 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (row k of A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again.

Examples

			The ninth composition in standard order is (3,1), which has consecutive subsequences (), (1), (3), (3,1), with sums 0, 1, 3, 4, so a(9) = 4.
		

Crossrefs

Dominated by A124771.
Compositions where every subinterval has a different sum are counted by A169942 and A325677 and ranked by A333222, while the case of partitions is counted by A325768 and ranked by A325779.
Positive subset-sums of partitions are counted by A276024 and A299701.
Knapsack partitions are counted by A108917 and ranked by A299702.
Knapsack compositions are counted by A325676 and A325687 and ranked by A333223.
The version for Heinz numbers of partitions is A325770.
Not allowing empty subsequences gives A333224.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Length[Union[ReplaceList[stc[n],{_,s___,_}:>Plus[s]]]],{n,0,100}]

Formula

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

A333223 Numbers k such that every distinct consecutive subsequence of the k-th composition in standard order has a different sum.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 15, 16, 17, 18, 19, 20, 21, 24, 26, 28, 31, 32, 33, 34, 35, 36, 40, 41, 42, 48, 50, 56, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 80, 81, 84, 85, 88, 96, 98, 100, 104, 106, 112, 120, 127, 128, 129, 130, 131, 132, 133
Offset: 1

Views

Author

Gus Wiseman, Mar 17 2020

Keywords

Comments

The k-th composition in standard order (row k of A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again.

Examples

			The list of terms together with the corresponding compositions begins:
    0: ()            21: (2,2,1)           65: (6,1)
    1: (1)           24: (1,4)             66: (5,2)
    2: (2)           26: (1,2,2)           67: (5,1,1)
    3: (1,1)         28: (1,1,3)           68: (4,3)
    4: (3)           31: (1,1,1,1,1)       69: (4,2,1)
    5: (2,1)         32: (6)               70: (4,1,2)
    6: (1,2)         33: (5,1)             71: (4,1,1,1)
    7: (1,1,1)       34: (4,2)             72: (3,4)
    8: (4)           35: (4,1,1)           73: (3,3,1)
    9: (3,1)         36: (3,3)             74: (3,2,2)
   10: (2,2)         40: (2,4)             80: (2,5)
   12: (1,3)         41: (2,3,1)           81: (2,4,1)
   15: (1,1,1,1)     42: (2,2,2)           84: (2,2,3)
   16: (5)           48: (1,5)             85: (2,2,2,1)
   17: (4,1)         50: (1,3,2)           88: (2,1,4)
   18: (3,2)         56: (1,1,4)           96: (1,6)
   19: (3,1,1)       63: (1,1,1,1,1,1)     98: (1,4,2)
   20: (2,3)         64: (7)              100: (1,3,3)
		

Crossrefs

Distinct subsequences are counted by A124770 and A124771.
A superset of A333222, counted by A169942, with partition case A325768.
These compositions are counted by A325676.
A version for partitions is A325769, with Heinz numbers A325778.
The number of distinct positive subsequence-sums is A333224.
The number of distinct subsequence-sums is A333257.
Numbers whose binary indices are a strict knapsack partition are A059519.
Knapsack partitions are counted by A108917, with strict case A275972.
Golomb subsets are counted by A143823.
Heinz numbers of knapsack partitions are A299702.
Maximal Golomb rulers are counted by A325683.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,100],UnsameQ@@Total/@Union[ReplaceList[stc[#],{_,s__,_}:>{s}]]&]

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

A333222 Numbers k such that every restriction of the k-th composition in standard order to a subinterval has a different sum.

Original entry on oeis.org

0, 1, 2, 4, 5, 6, 8, 9, 12, 16, 17, 18, 20, 24, 32, 33, 34, 40, 41, 48, 50, 64, 65, 66, 68, 69, 70, 72, 80, 81, 88, 96, 98, 104, 128, 129, 130, 132, 133, 134, 144, 145, 160, 161, 176, 192, 194, 196, 208, 256, 257, 258, 260, 261, 262, 264, 265, 268, 272, 274
Offset: 1

Views

Author

Gus Wiseman, Mar 17 2020

Keywords

Comments

Also numbers whose binary indices together with 0 define a Golomb ruler.
The k-th composition in standard order (row k of A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again.

Examples

			The list of terms together with the corresponding compositions begins:
    0: ()        41: (2,3,1)    130: (6,2)      262: (6,1,2)
    1: (1)       48: (1,5)      132: (5,3)      264: (5,4)
    2: (2)       50: (1,3,2)    133: (5,2,1)    265: (5,3,1)
    4: (3)       64: (7)        134: (5,1,2)    268: (5,1,3)
    5: (2,1)     65: (6,1)      144: (3,5)      272: (4,5)
    6: (1,2)     66: (5,2)      145: (3,4,1)    274: (4,3,2)
    8: (4)       68: (4,3)      160: (2,6)      276: (4,2,3)
    9: (3,1)     69: (4,2,1)    161: (2,5,1)    288: (3,6)
   12: (1,3)     70: (4,1,2)    176: (2,1,5)    289: (3,5,1)
   16: (5)       72: (3,4)      192: (1,7)      290: (3,4,2)
   17: (4,1)     80: (2,5)      194: (1,5,2)    296: (3,2,4)
   18: (3,2)     81: (2,4,1)    196: (1,4,3)    304: (3,1,5)
   20: (2,3)     88: (2,1,4)    208: (1,2,5)    320: (2,7)
   24: (1,4)     96: (1,6)      256: (9)        321: (2,6,1)
   32: (6)       98: (1,4,2)    257: (8,1)      324: (2,4,3)
   33: (5,1)    104: (1,2,4)    258: (7,2)      328: (2,3,4)
   34: (4,2)    128: (8)        260: (6,3)      352: (2,1,6)
   40: (2,4)    129: (7,1)      261: (6,2,1)    384: (1,8)
		

Crossrefs

A subset of A233564.
Also a subset of A333223.
These compositions are counted by A169942 and A325677.
The number of distinct nonzero subsequence-sums is A333224.
The number of distinct subsequence-sums is A333257.
Lengths of optimal Golomb rulers are A003022.
Inequivalent optimal Golomb rulers are counted by A036501.
Complete rulers are A103295, with perfect case A103300.
Knapsack partitions are counted by A108917, with strict case A275972.
Distinct subsequences are counted by A124770 and A124771.
Golomb subsets are counted by A143823.
Heinz numbers of knapsack partitions are A299702.
Knapsack compositions are counted by A325676.
Maximal Golomb rulers are counted by A325683.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,300],UnsameQ@@ReplaceList[stc[#],{_,s__,_}:>Plus[s]]&]

A325677 Irregular triangle read by rows where T(n,k) is the number of Golomb rulers of length n with k + 1 marks, k > 0.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 1, 4, 1, 4, 2, 1, 6, 6, 1, 6, 8, 1, 8, 18, 1, 8, 16, 1, 10, 30, 4, 1, 10, 34, 14, 1, 12, 48, 28, 1, 12, 48, 42, 1, 14, 72, 76, 1, 14, 72, 100, 1, 16, 96, 160, 8, 1, 16, 98, 190, 8, 1, 18, 126, 284, 40, 1, 18, 128, 316, 70
Offset: 1

Views

Author

Gus Wiseman, May 13 2019

Keywords

Comments

Also the number of length-k compositions of n such that every restriction to a subinterval has a different sum. A composition of n is a finite sequence of positive integers summing to n.

Examples

			Triangle begins:
   1
   1
   1   2
   1   2
   1   4
   1   4   2
   1   6   6
   1   6   8
   1   8  18
   1   8  16
   1  10  30   4
   1  10  34  14
   1  12  48  28
   1  12  48  42
   1  14  72  76
   1  14  72 100
   1  16  96 160   8
   1  16  98 190   8
   1  18 126 284  40
   1  18 128 316  70
Row n = 8 counts the following rulers:
  {0,8}  {0,1,8}  {0,1,3,8}
         {0,2,8}  {0,1,5,8}
         {0,3,8}  {0,1,6,8}
         {0,5,8}  {0,2,3,8}
         {0,6,8}  {0,2,7,8}
         {0,7,8}  {0,3,7,8}
                  {0,5,6,8}
                  {0,5,7,8}
and the following compositions:
  (8)  (17)  (125)
       (26)  (143)
       (35)  (152)
       (53)  (215)
       (62)  (251)
       (71)  (341)
             (512)
             (521)
		

Crossrefs

Row sums are A169942.
Row lengths are A325678(n) = A143824(n + 1) - 1.
Column k = 2 is A052928.
Column k = 3 is A325686.
Rightmost column is A325683.

Programs

  • Mathematica
    DeleteCases[Table[Length[Select[Join@@Permutations/@IntegerPartitions[n,{k}],UnsameQ@@ReplaceList[#,{_,s__,_}:>Plus[s]]&]],{n,15},{k,n}],0,{2}]
Showing 1-10 of 48 results. Next