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 19 results. Next

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

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

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}]

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.

A325768 Number of integer partitions of n for which every restriction to a subinterval has a different sum.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 3, 5, 5, 8, 7, 11, 12, 15, 15, 23, 22, 29, 32, 40, 42, 55, 56, 71, 75, 92, 100, 124, 128, 152, 167, 198, 212, 255, 269, 315, 343, 392, 428, 501, 529, 615, 665, 757, 812, 937, 1002, 1142, 1238, 1385, 1490, 1701, 1808, 2038, 2200, 2476
Offset: 0

Views

Author

Gus Wiseman, May 21 2019

Keywords

Comments

Also the number of Golomb rulers of length n whose consecutive marks are separated by weakly decreasing distances.
The Heinz numbers of these partitions are given by A325779.

Examples

			The a(1) = 1 through a(9) = 8 partitions:
  (1)  (2)  (3)   (4)   (5)   (6)   (7)    (8)    (9)
            (21)  (31)  (32)  (42)  (43)   (53)   (54)
                        (41)  (51)  (52)   (62)   (63)
                                    (61)   (71)   (72)
                                    (421)  (521)  (81)
                                                  (432)
                                                  (531)
                                                  (621)
		

Crossrefs

Programs

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

A124770 Number of distinct nonempty subsequences for compositions in standard order.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The standard order of compositions is given by A066099.
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. This gives a bijective correspondence between nonnegative integers and integer compositions. - Gus Wiseman, Apr 03 2020

Examples

			Composition number 11 is 2,1,1; the nonempty subsequences are 1; 2; 1,1; 2,1; 2,1,1; so a(11) = 5.
The table starts:
  0
  1
  1 2
  1 3 3 3
  1 3 2 5 3 5 5 4
  1 3 3 5 3 5 5 7 3 5 5 8 5 8 7 5
From _Gus Wiseman_, Apr 03 2020: (Start)
If the k-th composition in standard order is c, then we say that the STC-number of c is k. The STC-numbers of the distinct subsequences of the composition with STC-number k are given in column k below:
  1  2  1  4  1  1  1  8  1  2   1   1   1   1   1   16  1   2   1   2
        3     2  2  3     4  10  2   4   2   2   3       8   4   4   4
              5  6  7     9      3   12  6   3   7       17  18  3   20
                                 5       5   6   15              9
                                 11      13  14                  19
(End)
		

Crossrefs

Row lengths are A011782.
Allowing empty subsequences gives A124771.
Dominates A333224, the version counting subsequence-sums instead of subsequences.
Compositions where every restriction to a 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 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.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Length[Union[ReplaceList[stc[n],{_,s__,_}:>{s}]]],{n,0,100}] (* Gus Wiseman, Apr 03 2020 *)

Formula

a(n) = A124771(n) - 1. - Gus Wiseman, Apr 03 2020

A325680 Number of compositions of n such that every distinct circular subsequence has a different sum.

Original entry on oeis.org

1, 1, 2, 4, 5, 6, 8, 14, 16, 29, 24, 42, 46, 78, 66, 146, 133, 242, 208, 386, 352, 620, 494, 948, 842, 1447
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 subsequence is a sequence of consecutive terms where the first and last parts are also considered consecutive.

Examples

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

Crossrefs

Programs

  • Mathematica
    subalt[q_]:=Union[ReplaceList[q,{_,s__,_}:>{s}],DeleteCases[ReplaceList[q,{t___,,u___}:>{u,t}],{}]];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],UnsameQ@@Total/@subalt[#]&]],{n,0,15}]

Extensions

a(18)-a(25) from Robert Price, Jun 19 2021
Showing 1-10 of 19 results. Next