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

A373949 Triangle read by rows where T(n,k) is the number of integer compositions of n such that replacing each run of repeated parts with a single part (run-compression) yields a composition of k.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 0, 3, 0, 1, 1, 2, 4, 0, 1, 0, 4, 4, 7, 0, 1, 1, 5, 6, 5, 14, 0, 1, 0, 6, 10, 10, 14, 23, 0, 1, 1, 6, 14, 12, 29, 26, 39, 0, 1, 0, 9, 16, 19, 40, 54, 46, 71, 0, 1, 1, 8, 22, 22, 64, 82, 96, 92, 124, 0, 1, 0, 10, 26, 30, 82, 137, 144, 204, 176, 214
Offset: 0

Views

Author

Gus Wiseman, Jun 28 2024

Keywords

Examples

			Triangle begins:
   1
   0   1
   0   1   1
   0   1   0   3
   0   1   1   2   4
   0   1   0   4   4   7
   0   1   1   5   6   5  14
   0   1   0   6  10  10  14  23
   0   1   1   6  14  12  29  26  39
   0   1   0   9  16  19  40  54  46  71
   0   1   1   8  22  22  64  82  96  92 124
   0   1   0  10  26  30  82 137 144 204 176 214
   0   1   1  11  32  31 121 186 240 331 393 323 378
Row n = 6 counts the following compositions:
  .  (111111)  (222)  (33)     (3111)   (411)   (6)
                      (2211)   (1113)   (114)   (51)
                      (1122)   (1221)   (1311)  (15)
                      (21111)  (12111)  (1131)  (42)
                      (11112)  (11211)  (2112)  (24)
                               (11121)          (141)
                                                (321)
                                                (312)
                                                (231)
                                                (213)
                                                (132)
                                                (123)
                                                (2121)
                                                (1212)
For example, the composition (1,2,2,1) with compression (1,2,1) is counted under T(6,4).
		

Crossrefs

Column k = n is A003242 (anti-runs or compressed compositions).
Row-sums are A011782.
Same as A373951 with rows reversed.
Column k = 3 is A373952.
This statistic is represented by A373953, difference A373954.
A114901 counts compositions with no isolated parts.
A116861 counts partitions by compressed sum, by compressed length A116608.
A124767 counts runs in standard compositions, anti-runs A333381.
A240085 counts compositions with no unique parts.
A333755 counts compositions by compressed length.
A373948 represents the run-compression transformation.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations /@ IntegerPartitions[n],Total[First/@Split[#]]==k&]], {n,0,10},{k,0,n}]
  • PARI
    T_xy(row_max) = {my(N=row_max+1, x='x+O('x^N), h=1/(1-sum(i=1,N, (y^i*x^i)/(1+x^i*(y^i-1))))); vector(N, n, Vecrev(polcoeff(h, n-1)))}
    T_xy(13) \\ John Tyler Rascoe, Mar 20 2025

Formula

G.f.: 1/(1 - Sum_{i>0} (y^i * x^i)/(1 + x^i * (y^i - 1))). - John Tyler Rascoe, Mar 20 2025

A373953 Sum of run-compression of the n-th integer composition in standard order.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jun 25 2024

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.
We define the (run-) compression of a sequence to be the anti-run obtained by reducing each run of repeated parts to a single part. Alternatively, compression removes all parts equal to the part immediately to their left. For example, (1,1,2,2,1) has compression (1,2,1).

Examples

			The standard compositions and their compressions and compression sums begin:
   0: ()        --> ()      --> 0
   1: (1)       --> (1)     --> 1
   2: (2)       --> (2)     --> 2
   3: (1,1)     --> (1)     --> 1
   4: (3)       --> (3)     --> 3
   5: (2,1)     --> (2,1)   --> 3
   6: (1,2)     --> (1,2)   --> 3
   7: (1,1,1)   --> (1)     --> 1
   8: (4)       --> (4)     --> 4
   9: (3,1)     --> (3,1)   --> 4
  10: (2,2)     --> (2)     --> 2
  11: (2,1,1)   --> (2,1)   --> 3
  12: (1,3)     --> (1,3)   --> 4
  13: (1,2,1)   --> (1,2,1) --> 4
  14: (1,1,2)   --> (1,2)   --> 3
  15: (1,1,1,1) --> (1)     --> 1
		

Crossrefs

Positions of 1's are A000225.
Counting partitions by this statistic gives A116861, by length A116608.
For length instead of sum we have A124767, counted by A238279 and A333755.
Compositions counted by this statistic are A373949, opposite A373951.
A037201 gives compression of first differences of primes, halved A373947.
A066099 lists the parts of all compositions in standard order.
A114901 counts compositions with no isolated parts.
A240085 counts compositions with no unique parts.
A333489 ranks anti-runs, counted by A003242.

Programs

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

Formula

a(n) = A029837(A373948(n)).

A373954 Excess run-compression of standard compositions. Sum of all parts minus sum of compressed parts of the n-th integer composition in standard order.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jun 27 2024

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.
We define the (run-) compression of a sequence to be the anti-run obtained by reducing each run of repeated parts to a single part. Alternatively, compression removes all parts equal to the part immediately to their left. For example, (1,1,2,2,1) has compression (1,2,1).

Examples

			The excess compression of (2,1,1,3) is 1, so a(92) = 1.
		

Crossrefs

For length instead of sum we have A124762, counted by A106356.
The opposite for length is A124767, counted by A238279 and A333755.
Positions of zeros are A333489, counted by A003242.
Positions of nonzeros are A348612, counted by A131044.
Compositions counted by this statistic are A373951, opposite A373949.
Compression of standard compositions is A373953.
Positions of ones are A373955.
A037201 gives compression of first differences of primes, halved A373947.
A066099 lists the parts of all compositions in standard order.
A114901 counts compositions with no isolated parts.
A116861 counts partitions by this statistic, by length A116608.
A240085 counts compositions with no unique parts.
A333627 takes the rank of a composition to the rank of its run-lengths.

Programs

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

Formula

a(n) = A029837(n) - A373953(n).

A373951 Triangle read by rows where T(n,k) is the number of integer compositions of n such that replacing each run of repeated parts with a single part (run-compression) yields a composition of n - k.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 3, 0, 1, 0, 4, 2, 1, 1, 0, 7, 4, 4, 0, 1, 0, 14, 5, 6, 5, 1, 1, 0, 23, 14, 10, 10, 6, 0, 1, 0, 39, 26, 29, 12, 14, 6, 1, 1, 0, 71, 46, 54, 40, 19, 16, 9, 0, 1, 0, 124, 92, 96, 82, 64, 22, 22, 8, 1, 1, 0, 214, 176, 204, 144, 137, 82, 30, 26, 10, 0, 1, 0
Offset: 0

Views

Author

Gus Wiseman, Jun 28 2024

Keywords

Examples

			Triangle begins:
    1
    1   0
    1   1   0
    3   0   1   0
    4   2   1   1   0
    7   4   4   0   1   0
   14   5   6   5   1   1   0
   23  14  10  10   6   0   1   0
   39  26  29  12  14   6   1   1   0
   71  46  54  40  19  16   9   0   1   0
  124  92  96  82  64  22  22   8   1   1   0
Row n = 6 counts the following compositions:
  (6)     (411)   (3111)   (33)     (222)  (111111)  .
  (51)    (114)   (1113)   (2211)
  (15)    (1311)  (1221)   (1122)
  (42)    (1131)  (12111)  (21111)
  (24)    (2112)  (11211)  (11112)
  (141)           (11121)
  (321)
  (312)
  (231)
  (213)
  (132)
  (123)
  (2121)
  (1212)
For example, the composition (1,2,2,1) with compression (1,2,1) is counted under T(6,2).
		

Crossrefs

Column k = 0 is A003242 (anti-runs or compressed compositions).
Row-sums are A011782.
Same as A373949 with rows reversed.
Column k = 1 is A373950.
This statistic is represented by A373954, difference A373953.
A114901 counts compositions with no isolated parts.
A116861 counts partitions by compressed sum, by compressed length A116608.
A124767 counts runs in standard compositions, anti-runs A333381.
A240085 counts compositions with no unique parts.
A333755 counts compositions by compressed length.
A373948 represents the run-compression transformation.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations /@ IntegerPartitions[n], Total[First/@Split[#]]==n-k&]],{n,0,10},{k,0,n}]

A373952 Number of integer compositions of n whose run-compression sums to 3.

Original entry on oeis.org

0, 0, 0, 3, 2, 4, 5, 6, 6, 9, 8, 10, 11, 12, 12, 15, 14, 16, 17, 18, 18, 21, 20, 22, 23, 24, 24, 27, 26, 28, 29, 30, 30, 33, 32, 34, 35, 36, 36, 39, 38, 40, 41, 42, 42, 45, 44, 46, 47, 48, 48, 51, 50, 52, 53, 54, 54, 57, 56, 58, 59, 60, 60, 63, 62, 64, 65, 66
Offset: 0

Views

Author

Gus Wiseman, Jun 29 2024

Keywords

Comments

We define the (run-) compression of a sequence to be the anti-run obtained by reducing each run of repeated parts to a single part. Alternatively, compression removes all parts equal to the part immediately to their left. For example, (1,1,2,2,1) has compression (1,2,1).

Examples

			The a(3) = 3 through a(9) = 9 compositions:
  (3)   (112)  (122)   (33)     (1222)    (11222)    (333)
  (12)  (211)  (221)   (1122)   (2221)    (22211)    (12222)
  (21)         (1112)  (2211)   (11122)   (111122)   (22221)
               (2111)  (11112)  (22111)   (221111)   (111222)
                       (21111)  (111112)  (1111112)  (222111)
                                (211111)  (2111111)  (1111122)
                                                     (2211111)
                                                     (11111112)
                                                     (21111111)
		

Crossrefs

For partitions we appear to have A137719.
Column k = 3 of A373949, rows-reversed A373951.
The compression-sum statistic is represented by A373953, difference A373954.
A003242 counts compressed compositions (anti-runs).
A011782 counts compositions.
A114901 counts compositions with no isolated parts.
A116861 counts partitions by compressed sum, by compressed length A116608.
A124767 counts runs in standard compositions, anti-runs A333381.
A240085 counts compositions with no unique parts.
A333755 counts compositions by compressed length.
A373948 represents the run-compression transformation.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations /@ IntegerPartitions[n],Total[First/@Split[#]]==3&]],{n,0,10}]
  • PARI
    A_x(N)={my(x='x+O('x^N)); concat([0, 0, 0], Vec(x^3 *(3-x-x^2-x^3)/((1-x)*(1-x^2)*(1-x^3))))}
    A_x(50) \\ John Tyler Rascoe, Jul 01 2024

Formula

G.f.: x^3 * (3-x-x^2-x^3)/((1-x)*(1-x^2)*(1-x^3)). - John Tyler Rascoe, Jul 01 2024

Extensions

a(26) onwards from John Tyler Rascoe, Jul 01 2024

A373950 Number of integer compositions of n containing two adjacent ones and no other runs.

Original entry on oeis.org

0, 0, 1, 0, 2, 4, 5, 14, 26, 46, 92, 176, 323, 610, 1145, 2108, 3912, 7240, 13289, 24418, 44778, 81814, 149356, 272222, 495144, 899554, 1632176, 2957332, 5352495, 9677266, 17477761, 31536288, 56852495, 102403134, 184302331, 331452440, 595659234, 1069742760
Offset: 0

Views

Author

Gus Wiseman, Jun 28 2024

Keywords

Comments

Also the number of integer compositions of n such that replacing each run of repeated parts with a single part (run-compression) results in a composition of n-1.

Examples

			The a(0) = 0 through a(7) = 14 compositions:
  .  .  (11)  .  (112)  (113)   (114)   (115)
                 (211)  (311)   (411)   (511)
                        (1121)  (1131)  (1123)
                        (1211)  (1311)  (1132)
                                (2112)  (1141)
                                        (1411)
                                        (2113)
                                        (2311)
                                        (3112)
                                        (3211)
                                        (11212)
                                        (12112)
                                        (21121)
                                        (21211)
		

Crossrefs

For any run (not just of ones) we have A003242.
Subdiagonal of A373949.
These compositions are ranked by A373956.
A003242 counts compressed compositions.
A114901 counts compositions with no isolated parts.
A116861 counts partitions by compressed sum, by compressed length A116608.
A333755 counts compositions by compressed length (number of runs).
A373948 represents the run-compression transformation.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations /@ IntegerPartitions[n], Total[First/@Split[#]]==n-1&]],{n,0,10}]
  • PARI
    A_x(N)={my(x='x+O('x^N), h=x/((1+x)^2*(1-sum(i=1,N, (x^i /(1+x^i))))^2)); concat([0, 0], Vec(h))}
    A_x(40) \\ John Tyler Rascoe, Jul 02 2024

Formula

a(n>0) = A373949(n,n-1).
G.f.: x/((1-x)^2 * (1 - Sum_{i>0} (x^i/(1+x^i)))^2). - John Tyler Rascoe, Jul 02 2024

Extensions

a(26) onwards from John Tyler Rascoe, Jul 02 2024

A374254 Numbers k such that the k-th composition in standard order is an anti-run and matches the patterns (1,2,1) or (2,1,2).

Original entry on oeis.org

13, 22, 25, 45, 49, 54, 76, 77, 82, 89, 97, 101, 102, 105, 108, 109, 141, 148, 150, 153, 162, 165, 166, 177, 178, 180, 182, 193, 197, 198, 204, 205, 209, 210, 216, 217, 269, 278, 280, 281, 297, 300, 301, 305, 306, 308, 310, 322, 325, 326, 332, 333, 353, 354
Offset: 1

Views

Author

Gus Wiseman, Jul 14 2024

Keywords

Comments

Such a composition cannot be strict.
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:
   13: (1,2,1)
   22: (2,1,2)
   25: (1,3,1)
   45: (2,1,2,1)
   49: (1,4,1)
   54: (1,2,1,2)
   76: (3,1,3)
   77: (3,1,2,1)
   82: (2,3,2)
   89: (2,1,3,1)
   97: (1,5,1)
  101: (1,3,2,1)
  102: (1,3,1,2)
  105: (1,2,3,1)
  108: (1,2,1,3)
  109: (1,2,1,2,1)
  141: (4,1,2,1)
  148: (3,2,3)
  150: (3,2,1,2)
  153: (3,1,3,1)
		

Crossrefs

Compositions of this type are counted by A285981.
Permutations of prime indices of this type are counted by A335460.
This is the anti-run complement case of A374249, counted by A274174.
This is the anti-run case of A374253, counted by A335548.
A003242 counts anti-run compositions, ranks A333489.
A011782 counts compositions.
A025047 counts wiggly compositions, ranks A345167.
A066099 lists compositions in standard order.
A124767 counts runs in standard compositions, anti-runs A333381.
A233564 ranks strict compositions, counted by A032020.
A333755 counts compositions by number of runs.
A335454 counts patterns matched by standard compositions.
A335456 counts patterns matched by compositions.
A335462 counts (1,2,1)- and (2,1,2)-matching permutations of prime indices.
A335465 counts minimal patterns avoided by a standard composition.
- A335470 counts (1,2,1)-matching compositions, ranks A335466.
- A335471 counts (1,2,1)-avoiding compositions, ranks A335467.
- A335472 counts (2,1,2)-matching compositions, ranks A335468.
- A335473 counts (2,1,2)-avoiding compositions, ranks A335469.
A373948 encodes run-compression using compositions in standard order.
A373949 counts compositions by run-compressed sum, opposite A373951.
A373953 gives run-compressed sum of standard compositions, excess A373954.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,100],Length[Split[stc[#]]] == Length[stc[#]]&&!UnsameQ@@First/@Split[stc[#]]&]

Formula

Equals A333489 /\ A374253.

A373955 Numbers k such that the k-th integer composition in standard order contains two adjacent ones and no other runs.

Original entry on oeis.org

3, 11, 14, 19, 27, 28, 29, 35, 46, 51, 56, 57, 67, 75, 78, 83, 91, 92, 93, 99, 110, 112, 113, 114, 116, 118, 131, 139, 142, 155, 156, 157, 163, 179, 184, 185, 195, 203, 206, 211, 219, 220, 221, 224, 225, 226, 229, 230, 232, 233, 236, 237, 259, 267, 270, 275
Offset: 1

Views

Author

Gus Wiseman, Jun 29 2024

Keywords

Comments

Also numbers k such that the excess compression of the k-th integer composition in standard order is 1.
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.
postn of 1 in

Examples

			The terms and corresponding compositions begin:
    3: (1,1)
   11: (2,1,1)
   14: (1,1,2)
   19: (3,1,1)
   27: (1,2,1,1)
   28: (1,1,3)
   29: (1,1,2,1)
   35: (4,1,1)
   46: (2,1,1,2)
   51: (1,3,1,1)
   56: (1,1,4)
   57: (1,1,3,1)
   67: (5,1,1)
   75: (3,2,1,1)
   78: (3,1,1,2)
   83: (2,3,1,1)
   91: (2,1,2,1,1)
   92: (2,1,1,3)
   93: (2,1,1,2,1)
   99: (1,4,1,1)
		

Crossrefs

These compositions are counted by A373950.
Positions of ones in A373954.
A003242 counts compressed compositions (or anti-runs).
A114901 counts compositions with no isolated parts.
A116861 counts partitions by compressed sum, by compressed length A116608.
A124767 counts runs in standard compositions, anti-runs A333381.
A240085 counts compositions with no unique parts.
A333755 counts compositions by compressed length.
A373948 encodes compression using compositions in standard order.
A373949 counts compositions by compression-sum.
A373953 gives compression-sum of standard compositions.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[100],Total[stc[#]] == Total[First/@Split[stc[#]]]+1&]

A373420 Number of Carlitz compositions of n (see A003242) such that the first and last parts are equal.

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 2, 7, 11, 17, 26, 54, 86, 155, 272, 464, 816, 1447, 2507, 4400, 7706, 13456, 23570, 41293, 72212, 126394, 221282, 387219, 677714, 1186311, 2076170, 3633761, 6360219, 11131698, 19483066, 34100455, 59683664, 104460655, 182832044, 319999739
Offset: 0

Views

Author

John Tyler Rascoe, Aug 16 2024

Keywords

Examples

			a(7) = 7 counts: (1,2,1,2,1), (1,2,3,1), (1,3,2,1), (1,5,1), (2,3,2), (3,1,3), and (7).
		

Crossrefs

Programs

  • PARI
    C_x(N) = {my(g=1/(1-sum(k=1, N, x^k/(1+x^k))));g}
    A_x(i,N) = {my( x='x+O('x^N), f=(x^i)*(C_x(N)*(x^i)+x^i+1)/(1+x^i)^2);f}
    D_x(N) = {my( x='x+O('x^N), f=1+sum(i=1,N, A_x(i,N))); Vec(f)}
    D_x(40)

Formula

G.f.: 1 + Sum_{i>0} (x^i)*(C(x)*(x^i) + x^i + 1)/(1+x^i)^2 where C(x) is the g.f. for A003242.
Showing 1-9 of 9 results.