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 10 results.

A357136 Triangle read by rows where T(n,k) is the number of integer compositions of n with alternating sum k = 0..n. Part of the full triangle A097805.

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 0, 2, 0, 1, 3, 0, 3, 0, 1, 0, 6, 0, 4, 0, 1, 10, 0, 10, 0, 5, 0, 1, 0, 20, 0, 15, 0, 6, 0, 1, 35, 0, 35, 0, 21, 0, 7, 0, 1, 0, 70, 0, 56, 0, 28, 0, 8, 0, 1, 126, 0, 126, 0, 84, 0, 36, 0, 9, 0, 1, 0, 252, 0, 210, 0, 120, 0, 45, 0, 10, 0, 1
Offset: 0

Views

Author

Gus Wiseman, Sep 30 2022

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.
The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.

Examples

			Triangle begins:
    1
    0   1
    1   0   1
    0   2   0   1
    3   0   3   0   1
    0   6   0   4   0   1
   10   0  10   0   5   0   1
    0  20   0  15   0   6   0   1
   35   0  35   0  21   0   7   0   1
    0  70   0  56   0  28   0   8   0   1
  126   0 126   0  84   0  36   0   9   0   1
    0 252   0 210   0 120   0  45   0  10   0   1
  462   0 462   0 330   0 165   0  55   0  11   0   1
    0 924   0 792   0 495   0 220   0  66   0  12   0   1
For example, row n = 5 counts the following compositions:
  .  (32)     .  (41)   .  (5)
     (122)       (113)
     (221)       (212)
     (1121)      (311)
     (2111)
     (11111)
		

Crossrefs

The full triangle counting compositions by alternating sum is A097805.
The version for partitions is A103919, full triangle A344651.
This is the right-half of even-indexed rows of A260492.
The triangle without top row and left column is A108044.
Ranking and counting compositions:
- product = sum: A335404, counted by A335405.
- sum = twice alternating sum: A348614, counted by A262977.
- length = alternating sum: A357184, counted by A357182.
- length = absolute value of alternating sum: A357185, counted by A357183.
A003242 counts anti-run compositions, ranked by A333489.
A011782 counts compositions.
A025047 counts alternating compositions, ranked by A345167.
A032020 counts strict compositions, ranked by A233564.
A124754 gives alternating sums of standard compositions.
A238279 counts compositions by sum and number of maximal runs.

Programs

  • Mathematica
    Prepend[Table[If[EvenQ[nn],Prepend[#,0],#]&[Riffle[Table[Binomial[nn,k],{k,Floor[nn/2],nn}],0]],{nn,0,10}],{1}]

A357182 Number of integer compositions of n with the same length as their alternating sum.

Original entry on oeis.org

1, 1, 0, 0, 1, 3, 1, 4, 6, 20, 13, 48, 50, 175, 141, 512, 481, 1719, 1491, 5400, 4929, 17776, 15840, 57420, 52079, 188656, 169989, 617176, 559834, 2033175, 1842041, 6697744, 6085950, 22139780, 20123989, 73262232, 66697354, 242931321, 221314299, 806516560
Offset: 0

Views

Author

Gus Wiseman, Sep 28 2022

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.
The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.

Examples

			The a(1) = 1 through a(8) = 6 compositions:
  (1)  (31)  (113)  (42)  (124)  (53)
             (212)        (223)  (1151)
             (311)        (322)  (2141)
                          (421)  (3131)
                                 (4121)
                                 (5111)
		

Crossrefs

For product instead of length we have A114220.
For sum equal to twice alternating sum we have A262977, ranked by A348614.
For product equal to sum we have A335405, ranked by A335404.
For absolute value we have A357183.
These compositions are ranked by A357184.
The case of partitions is A357189.
A003242 counts anti-run compositions, ranked by A333489.
A011782 counts compositions.
A025047 counts alternating compositions, ranked by A345167.
A124754 gives alternating sums of standard compositions.
A238279 counts compositions by sum and number of maximal runs.
A261983 counts non-anti-run compositions.
A357136 counts compositions by alternating sum.

Programs

  • Mathematica
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],Length[#]==ats[#]&]],{n,0,15}]

Extensions

a(21)-a(39) from Alois P. Heinz, Sep 29 2022

A357184 Numbers k such that the k-th composition in standard order has the same length as its alternating sum.

Original entry on oeis.org

0, 1, 9, 19, 22, 28, 34, 69, 74, 84, 104, 132, 135, 141, 153, 177, 225, 265, 271, 274, 283, 286, 292, 307, 310, 316, 328, 355, 358, 364, 376, 400, 451, 454, 460, 472, 496, 520, 523, 526, 533, 538, 553, 562, 593, 610, 673, 706, 833, 898, 1041, 1047, 1053, 1058
Offset: 1

Views

Author

Gus Wiseman, Sep 28 2022

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (graded reverse-lexicographic, 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.
The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.

Examples

			The sequence together with the corresponding compositions begins:
    0: ()
    1: (1)
    9: (3,1)
   19: (3,1,1)
   22: (2,1,2)
   28: (1,1,3)
   34: (4,2)
   69: (4,2,1)
   74: (3,2,2)
   84: (2,2,3)
  104: (1,2,4)
  132: (5,3)
  135: (5,1,1,1)
  141: (4,1,2,1)
  153: (3,1,3,1)
  177: (2,1,4,1)
  225: (1,1,5,1)
		

Crossrefs

See link for sequences related to standard compositions.
For product equal to sum we have A335404, counted by A335405.
For sum equal to twice alternating sum we have A348614, counted by A262977.
These compositions are counted by A357182.
For absolute value we have A357184, counted by A357183.
The case of partitions is counted by A357189.
A003242 counts anti-run compositions, ranked by A333489.
A011782 counts compositions.
A025047 counts alternating compositions, ranked by A345167.
A032020 counts strict compositions, ranked by A233564.
A124754 gives alternating sums of standard compositions.
A238279 counts compositions by sum and number of maximal runs.
A357136 counts compositions by alternating sum.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    Select[Range[0,100],Length[stc[#]]==ats[stc[#]]&]

A357183 Number of integer compositions with the same length as the absolute value of their alternating sum.

Original entry on oeis.org

1, 1, 0, 0, 2, 3, 2, 5, 12, 22, 26, 58, 100, 203, 282, 616, 962, 2045, 2982, 6518, 9858, 21416, 31680, 69623, 104158, 228930, 339978, 751430, 1119668, 2478787, 3684082, 8182469, 12171900, 27082870, 40247978, 89748642, 133394708, 297933185, 442628598, 990210110
Offset: 0

Views

Author

Gus Wiseman, Sep 28 2022

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.
The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.

Examples

			The a(1) = 1 through a(8) = 12 compositions:
  (1)  (13)  (113)  (24)  (124)  (35)
       (31)  (212)  (42)  (151)  (53)
             (311)        (223)  (1115)
                          (322)  (1151)
                          (421)  (1214)
                                 (1313)
                                 (1412)
                                 (1511)
                                 (2141)
                                 (3131)
                                 (4121)
                                 (5111)
		

Crossrefs

For product instead of length we have A114220.
For sum equal to twice alternating sum we have A262977, ranked by A348614.
For product equal to sum we have A335405, ranked by A335404.
This is the absolute value version of A357182.
These compositions are ranked by A357185.
The case of partitions is A357189.
A003242 counts anti-run compositions, ranked by A333489.
A011782 counts compositions.
A025047 counts alternating compositions, ranked by A345167.
A124754 gives alternating sums of standard compositions.
A238279 counts compositions by sum and number of maximal runs.
A261983 counts non-anti-run compositions.
A357136 counts compositions by alternating sum.

Programs

  • Mathematica
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],Length[#]==Abs[ats[#]]&]],{n,0,15}]

Extensions

a(21)-a(39) from Alois P. Heinz, Sep 29 2022

A335405 Number of integer compositions of n with product n.

Original entry on oeis.org

0, 1, 1, 1, 2, 1, 7, 1, 23, 11, 21, 1, 241, 1, 43, 73, 1092, 1, 1041, 1, 1339, 157, 111, 1, 23023, 137, 157, 1603, 3945, 1, 11599, 1, 153446, 421, 273, 601, 204586, 1, 343, 601, 206351, 1, 34789, 1, 16273, 25179, 507, 1, 5992730, 667, 33913, 1057, 27291, 1
Offset: 0

Views

Author

Gus Wiseman, Jun 06 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.

Examples

			The compositions for n = 1, 4, 6, 8, 9, 10:
  (1)  (4)   (6)    (8)      (9)      (10)
       (22)  (123)  (1124)   (11133)  (11125)
             (132)  (1142)   (11313)  (11152)
             (213)  (1214)   (11331)  (11215)
             (231)  (1241)   (13113)  (11251)
             (312)  (1412)   (13131)  (11512)
             (321)  (1421)   (13311)  (11521)
                    (2114)   (31113)  (12115)
                    (2141)   (31131)  (12151)
                    (2411)   (31311)  (12511)
                    (4112)   (33111)  (15112)
                    (4121)            (15121)
                    (4211)            (15211)
                    (11222)           (21115)
                    (12122)           (21151)
                    (12212)           (21511)
                    (12221)           (25111)
                    (21122)           (51112)
                    (21212)           (51121)
                    (21221)           (51211)
                    (22112)           (52111)
                    (22121)
                    (22211)
		

Crossrefs

The case of partitions is A001055.
Compositions are counted by A011782.
These compositions are ranked by A335404.

Programs

  • Mathematica
    Table[Length[Join@@Permutations/@Select[IntegerPartitions[n],Times@@#==n&]],{n,0,30}]

A357135 Take the k-th composition in standard order for each part k of the n-th composition in standard order; then concatenate.

Original entry on oeis.org

1, 2, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 3, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 2, 1, 2, 2, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1
Offset: 0

Views

Author

Gus Wiseman, Sep 26 2022

Keywords

Comments

The k-th composition in standard order (graded reverse-lexicographic, 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.

Examples

			Triangle begins:
   0:
   1: 1
   2: 2
   3: 1 1
   4: 1 1
   5: 2 1
   6: 1 2
   7: 1 1 1
   8: 3
   9: 1 1 1
  10: 2 2
  11: 2 1 1
  12: 1 1 1
  13: 1 2 1
  14: 1 1 2
  15: 1 1 1 1
		

Crossrefs

See link for sequences related to standard compositions.
Row n is the A357134(n)-th composition in standard order.
The version for Heinz numbers of partitions is A357139, cf. A003963.
Row sums are A357186, differences A357187.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Join@@Table[Join@@stc/@stc[n],{n,0,30}]

Formula

Row n is the A357134(n)-th composition in standard order.

A357185 Numbers k such that the k-th composition in standard order has the same length as the absolute value of its alternating sum.

Original entry on oeis.org

0, 1, 9, 12, 19, 22, 28, 34, 40, 69, 74, 84, 97, 104, 132, 135, 141, 144, 153, 177, 195, 198, 204, 216, 225, 240, 265, 271, 274, 283, 286, 292, 307, 310, 316, 321, 328, 355, 358, 364, 376, 386, 400, 451, 454, 460, 472, 496, 520, 523, 526, 533, 538, 544, 553
Offset: 1

Views

Author

Gus Wiseman, Sep 28 2022

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (graded reverse-lexicographic, 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.
The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.

Examples

			The sequence together with the corresponding compositions begins:
    0: ()
    1: (1)
    9: (3,1)
   12: (1,3)
   19: (3,1,1)
   22: (2,1,2)
   28: (1,1,3)
   34: (4,2)
   40: (2,4)
   69: (4,2,1)
   74: (3,2,2)
   84: (2,2,3)
   97: (1,5,1)
  104: (1,2,4)
  132: (5,3)
  135: (5,1,1,1)
  141: (4,1,2,1)
		

Crossrefs

See link for sequences related to standard compositions.
For sum equal to twice alternating sum we have A348614, counted by A262977.
For product equal to sum we have A335404, counted by A335405.
These compositions are counted by A357183.
This is the absolute value version of A357184, counted by A357183.
A003242 counts anti-run compositions, ranked by A333489.
A011782 counts compositions.
A025047 counts alternating compositions, ranked by A345167.
A032020 counts strict compositions, ranked by A233564.
A124754 gives alternating sums of standard compositions.
A238279 counts compositions by sum and number of maximal runs.
A357136 counts compositions by alternating sum.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    Select[Range[0,100],Length[stc[#]]==Abs[ats[stc[#]]]&]

A357134 Take the k-th composition in standard order for each part k of the n-th composition in standard order; then set a(n) to be the index (in standard order) of the concatenation.

Original entry on oeis.org

0, 1, 2, 3, 3, 5, 6, 7, 4, 7, 10, 11, 7, 13, 14, 15, 5, 9, 14, 15, 11, 21, 22, 23, 12, 15, 26, 27, 15, 29, 30, 31, 6, 11, 18, 19, 15, 29, 30, 31, 20, 23, 42, 43, 23, 45, 46, 47, 13, 25, 30, 31, 27, 53, 54, 55, 28, 31, 58, 59, 31, 61, 62, 63, 7, 13, 22, 23, 19
Offset: 0

Views

Author

Gus Wiseman, Sep 24 2022

Keywords

Comments

The k-th composition in standard order (graded reverse-lexicographic, 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.

Examples

			The terms together with their corresponding standard compositions begin:
   0: ()
   1: (1)
   2: (2)
   3: (1,1)
   3: (1,1)
   5: (2,1)
   6: (1,2)
   7: (1,1,1)
   4: (3)
   7: (1,1,1)
  10: (2,2)
  11: (2,1,1)
   7: (1,1,1)
  13: (1,2,1)
  14: (1,1,2)
  15: (1,1,1,1)
		

Crossrefs

See link for sequences related to standard compositions.
The version for Heinz numbers of partitions is A003963.
The vertex-degrees are A048896.
The a(n)-th composition in standard order is row n of A357135.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    stcinv[q_]:=Total[2^(Accumulate[Reverse[q]])]/2;
    Table[stcinv[Join@@stc/@stc[n]],{n,0,30}]

Formula

For n > 0, the value n appears A048896(n - 1) times.
Row a(n) of A066099 = row n of A357135.

A357186 Take the k-th composition in standard order for each part k of the n-th composition in standard order, then add up everything.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Sep 28 2022

Keywords

Comments

The k-th composition in standard order (graded reverse-lexicographic, 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.

Examples

			Composition 92 in standard order is (2,1,1,3), with compositions ((2),(1),(1),(1,1)) so a(92) = 2 + 1 + 1 + 1 + 1 = 6.
		

Crossrefs

See link for sequences related to standard compositions.
This is the sum of A029837 over the n-th composition in standard order.
Vertex degrees are A133494.
The version for Heinz numbers of partitions is A325033.
Row sums of A357135.
First differences are A357187.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[stc/@stc[n]/.List->Plus,{n,0,100}]

Formula

a(n) = A029837(A357134(n)).

A358330 By concatenating the standard compositions of each part of the a(n)-th standard composition, we get a weakly increasing sequence.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 12, 14, 15, 18, 19, 24, 25, 26, 28, 30, 31, 32, 36, 38, 39, 40, 42, 50, 51, 56, 57, 58, 60, 62, 63, 64, 72, 73, 74, 76, 78, 79, 96, 100, 102, 103, 104, 106, 114, 115, 120, 121, 122, 124, 126, 127, 128, 129, 130, 136, 146, 147
Offset: 1

Views

Author

Gus Wiseman, Nov 10 2022

Keywords

Comments

Note we shorten the language, "the k-th composition in standard order," to "the standard composition of k."
The k-th composition in standard order (graded reverse-lexicographic, 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.

Examples

			The terms together with their standard compositions begin:
   0: ()
   1: (1)
   2: (2)
   3: (1,1)
   4: (3)
   6: (1,2)
   7: (1,1,1)
   8: (4)
   9: (3,1)
  10: (2,2)
  12: (1,3)
  14: (1,1,2)
  15: (1,1,1,1)
  18: (3,2)
  19: (3,1,1)
  24: (1,4)
  25: (1,3,1)
  26: (1,2,2)
For example, the 532,488-th composition is (6,10,4), with standard compositions ((1,2),(2,2),(3)), with weakly increasing concatenation (1,2,2,2,3), so 532,488 is in the sequence.
		

Crossrefs

See link for sequences related to standard compositions.
Standard compositions are listed by A066099.
Indices of rows of A357135 (ranked by A357134) that are weakly increasing.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,100],OrderedQ[Join@@stc/@stc[#]]&]
Showing 1-10 of 10 results.