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

A353400 Number of integer compositions of n with all run-lengths > 2.

Original entry on oeis.org

1, 0, 0, 1, 1, 1, 2, 1, 2, 4, 4, 5, 11, 11, 14, 27, 29, 37, 61, 72, 97, 147, 181, 246, 368, 470, 632, 914, 1198, 1611, 2286, 3018, 4079, 5709, 7619, 10329, 14333, 19258, 26142, 36069, 48688, 66114, 90800, 122913, 167020, 228735, 310167, 421708, 576499, 782803
Offset: 0

Views

Author

Gus Wiseman, May 15 2022

Keywords

Examples

			The a(7) = 1 through a(12) = 11 compositions:
  1111111   2222       333         22222        1112222       444
            11111111   111222      1111222      2222111       3333
                       222111      2221111      11111222      111333
                       111111111   1111111111   22211111      222222
                                                11111111111   333111
                                                              11112222
                                                              22221111
                                                              111111222
                                                              111222111
                                                              222111111
                                                              111111111111
		

Crossrefs

The = 2 version is A003242 aerated.
The <= 1 version is A003242 ranked by A333489.
The version for parts instead of run-lengths is A078012, both A353428.
The version for partitions is A100405.
The > 1 version is A114901, ranked by A353427.
The <= 2 version is A128695, matching A335464.
A008466 counts compositions with some part > 2.
A011782 counts compositions.
A106356 counts compositions by number of adjacent equal parts.
A274174 counts compositions with equal parts contiguous.
A329738 counts uniform compositions, partitions A047966.
A329739 counts compositions with all distinct run-lengths.

Programs

  • Maple
    b:= proc(n, h) option remember; `if`(n=0, 1, add(
         `if`(i<>h, add(b(n-i*j, i), j=3..n/i), 0), i=1..n/3))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..50);  # Alois P. Heinz, May 17 2022
  • Mathematica
    Table[Length[Select[Join@@Permutations/@ IntegerPartitions[n],!MemberQ[Length/@Split[#],1|2]&]],{n,0,15}]

Extensions

a(21)-a(49) from Alois P. Heinz, May 17 2022

A353401 Number of integer compositions of n with all prime run-lengths.

Original entry on oeis.org

1, 0, 1, 1, 1, 1, 4, 3, 6, 9, 10, 18, 27, 35, 54, 83, 107, 176, 242, 354, 515, 774, 1070, 1648, 2332, 3429, 4984, 7326, 10521, 15591, 22517, 32908, 48048, 70044, 101903, 149081, 216973, 316289, 461959, 672664, 981356, 1431256, 2086901, 3041577, 4439226, 6467735
Offset: 0

Views

Author

Gus Wiseman, May 15 2022

Keywords

Examples

			The a(0) = 1 through a(9) = 9 compositions (empty column indicated by dot, 0 is the empty composition):
  0   .  11   111   22   11111   33     11122     44       333
                                 222    22111     1133     11133
                                 1122   1111111   3311     33111
                                 2211             11222    111222
                                                  22211    222111
                                                  112211   1111122
                                                           1112211
                                                           1122111
                                                           2211111
		

Crossrefs

The case of runs equal to 2 is A003242 aerated.
The <= 1 version is A003242 ranked by A333489.
The version for parts instead of run-lengths is A023360, both A353429.
The version for partitions is A055923.
The > 1 version is A114901, ranked by A353427.
The <= 2 version is A128695, matching A335464.
The > 2 version is A353400, partitions A100405.
Words with all distinct run-lengths: A032020, A044813, A098859, A130091, A329739, A351013, A351017.
A005811 counts runs in binary expansion.
A008466 counts compositions with some part > 2.
A011782 counts compositions.
A167606 counts compositions with adjacent parts coprime.
A329738 counts uniform compositions, partitions A047966.

Programs

  • Maple
    b:= proc(n, h) option remember; `if`(n=0, 1, add(`if`(i<>h, add(
         `if`(isprime(j), b(n-i*j, i), 0), j=2..n/i), 0), i=1..n/2))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..60);  # Alois P. Heinz, May 18 2022
  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!MemberQ[Length/@Split[#],_?(!PrimeQ[#]&)]&]],{n,0,15}]

Extensions

a(21)-a(45) from Alois P. Heinz, May 18 2022

A353431 Numbers k such that the k-th composition in standard order is empty, a singleton, or has its own run-lengths as a subsequence (not necessarily consecutive) that is already counted.

Original entry on oeis.org

0, 1, 2, 4, 8, 10, 16, 32, 43, 58, 64, 128, 256, 292, 349, 442, 512, 586, 676, 697, 826, 1024, 1210, 1338, 1393, 1394, 1396, 1594, 2048, 2186, 2234, 2618, 2696, 2785, 2786, 2792, 3130, 4096, 4282, 4410, 4666, 5178, 5569, 5570, 5572, 5576, 5584, 6202, 8192
Offset: 1

Views

Author

Gus Wiseman, May 16 2022

Keywords

Comments

First differs from A353696 (the consecutive version) in having 22318, corresponding to the binary word 101011100101110 and standard composition (2,2,1,1,3,2,1,1,2), whose run-lengths (2,2,1,1,2,1) are subsequence but not a consecutive subsequence.
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 initial terms, their binary expansions, and the corresponding standard compositions:
     0:           0  ()
     1:           1  (1)
     2:          10  (2)
     4:         100  (3)
     8:        1000  (4)
    10:        1010  (2,2)
    16:       10000  (5)
    32:      100000  (6)
    43:      101011  (2,2,1,1)
    58:      111010  (1,1,2,2)
    64:     1000000  (7)
   128:    10000000  (8)
   256:   100000000  (9)
   292:   100100100  (3,3,3)
   349:   101011101  (2,2,1,1,2,1)
   442:   110111010  (1,2,1,1,2,2)
   512:  1000000000  (10)
   586:  1001001010  (3,3,2,2)
   676:  1010100100  (2,2,3,3)
   697:  1010111001  (2,2,1,1,3,1)
		

Crossrefs

The non-recursive version for partitions is A325755, counted by A325702.
These compositions are counted by A353391.
The version for partitions A353393, counted by A353426, w/o primes A353389.
The non-recursive version is A353402, counted by A353390.
The non-recursive consecutive case is A353432, counted by A353392.
The consecutive case is A353696, counted by A353430.
A005811 counts runs in binary expansion.
A011782 counts compositions.
A066099 lists compositions in standard order, rev A228351, run-lens A333769.
A329738 counts uniform compositions, partitions A047966.
Statistics of standard compositions:
- Length is A000120, sum A070939.
- Runs are counted by A124767, distinct A351014.
- Subsequences are counted by A334299, contiguous A124770/A124771.
- Runs-resistance is A333628.
Classes of standard compositions:
- Partitions are A114994, multisets A225620, strict A333255, sets A333256.
- Constant compositions are A272919, counted by A000005.
- Golomb rulers are A333222, counted by A169942.
- Knapsack compositions are A333223, counted by A325676.
- Anti-runs are A333489, counted by A003242.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    rorQ[y_]:=Length[y]<=1||MemberQ[Subsets[y],Length/@Split[y]]&& rorQ[Length/@Split[y]];
    Select[Range[0,100],rorQ[stc[#]]&]

A353428 Number of integer compositions of n with all parts and all run-lengths > 2.

Original entry on oeis.org

1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 2, 1, 0, 2, 0, 2, 4, 0, 0, 8, 3, 0, 10, 4, 4, 15, 4, 8, 24, 7, 8, 42, 16, 10, 59, 31, 27, 87, 37, 52, 149, 62, 66, 233, 121, 111, 342, 207, 204, 531, 308, 351, 864, 487, 536, 1373, 864, 865, 2057, 1440, 1509, 3232
Offset: 0

Views

Author

Gus Wiseman, May 16 2022

Keywords

Examples

			The a(n) compositions for selected n:
  n=16:   n=18:     n=20:    n=21:      n=24:
----------------------------------------------------
  (4444)  (666)     (5555)   (777)      (888)
          (333333)  (44444)  (333444)   (6666)
                             (444333)   (333555)
                             (3333333)  (444444)
                                        (555333)
                                        (3333444)
                                        (4443333)
                                        (33333333)
		

Crossrefs

Allowing any multiplicities gives A078012, partitions A008483.
The version for no (instead of all) parts or run-lengths > 2 is A137200.
Allowing any parts gives A353400, partitions A100405.
The version for partitions is A353501, ranked by A353502.
The version for > 1 instead of > 2 is A353508, partitions A339222.
A003242 counts anti-run compositions, ranked by A333489.
A008466 counts compositions with some part > 2.
A011782 counts compositions.
A114901 counts compositions with no runs of length 1, ranked by A353427.
A128695 counts compositions with no run-lengths > 2.
A261983 counts non-anti-run compositions.
A335464 counts compositions with a run-length > 2.

Programs

  • Maple
    b:= proc(n, h) option remember; `if`(n=0, 1, add(
         `if`(i=h, 0, add(b(n-i*j, i), j=3..n/i)), i=3..n/3))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..80);  # Alois P. Heinz, May 18 2022
  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!MemberQ[#,1|2]&&!MemberQ[Length/@Split[#],1|2]&]],{n,0,15}]

Extensions

a(26)-a(66) from Alois P. Heinz, May 17 2022

A353429 Number of integer compositions of n with all prime parts and all prime run-lengths.

Original entry on oeis.org

1, 0, 0, 0, 1, 0, 2, 0, 0, 1, 4, 0, 2, 2, 5, 4, 9, 1, 5, 12, 20, 11, 19, 18, 31, 43, 54, 37, 63, 95, 121, 124, 154, 178, 261, 353, 393, 417, 565, 770, 952, 1138, 1326, 1647, 2186, 2824, 3261, 3917, 4941, 6423, 7935, 9719, 11554, 14557, 18536, 23380, 27985
Offset: 0

Views

Author

Gus Wiseman, May 16 2022

Keywords

Examples

			The a(13) = 2 through a(16) = 9 compositions:
  (22333)  (77)       (555)     (3355)
  (33322)  (2255)     (33333)   (5533)
           (5522)     (222333)  (22255)
           (223322)   (333222)  (55222)
           (2222222)            (332233)
                                (2222233)
                                (2223322)
                                (2233222)
                                (3322222)
		

Crossrefs

The first condition only is A023360, partitions A000607.
For partitions we have A351982, only run-lens A100405, only parts A008483.
The second condition only is A353401, partitions A055923.
A003242 counts anti-run compositions, ranked by A333489.
A011782 counts compositions.
A052284 counts compositions into nonprimes, partitions A002095.
A106356 counts compositions by number of adjacent equal parts.
A114901 counts compositions with no runs of length 1, ranked by A353427.
A329738 counts uniform compositions, partitions A047966.

Programs

  • Maple
    b:= proc(n, h) option remember; `if`(n=0, 1, add(`if`(i<>h and isprime(i),
          add(`if`(isprime(j), b(n-i*j, i), 0), j=2..n/i), 0), i=2..n/2))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..70);  # Alois P. Heinz, May 18 2022
  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], And@@PrimeQ/@#&&And@@PrimeQ/@Length/@Split[#]&]],{n,0,15}]

Extensions

a(26)-a(56) from Alois P. Heinz, May 18 2022

A353508 Number of integer compositions of n with no ones or runs of length 1.

Original entry on oeis.org

1, 0, 0, 0, 1, 0, 2, 0, 2, 1, 4, 0, 8, 2, 11, 4, 21, 5, 37, 12, 57, 25, 104, 38, 177, 79, 292, 149, 513, 251, 876, 482, 1478, 871, 2562, 1533, 4387, 2815, 7473, 5036, 12908, 8935, 22135, 16085, 37940, 28611, 65422, 50731, 112459, 90408, 193386, 160119, 333513
Offset: 0

Views

Author

Gus Wiseman, May 17 2022

Keywords

Examples

			The a(0) = 1 through a(14) = 11 compositions (empty columns indicated by dots, 0 is the empty composition):
  0  .  .  .  22  .  33   .  44    333  55     .  66      22333  77
                     222     2222       2233      444     33322  2255
                                        3322      2244           3344
                                        22222     3333           4433
                                                  4422           5522
                                                  22233          22244
                                                  33222          44222
                                                  222222         222233
                                                                 223322
                                                                 332222
                                                                 2222222
		

Crossrefs

The version for partitions is A339222.
Compositions counted by their run-lengths:
- For run-lengths <= 1 we have A003242, ranked by A333489.
- For run-lengths = 2 we have A003242 aerated.
- For run-lengths > 1 we have A114901, ranked by A353427.
- For run-lengths <= 2 we have A128695 matching A335464.
- For run-lengths > 2 we have A353400, partitions A100405.
- For run-lengths all prime we have A353401.
- For run-lengths and parts > 2 we have A353428.
A008466 counts compositions with some part > 2.
A011782 counts compositions.
A106356 counts compositions by number of adjacent equal parts.
A261983 counts non-anti-run compositions.
A274174 counts compositions with equal parts contiguous.

Programs

  • Maple
    b:= proc(n,h) option remember; `if`(n=0, 1, add(
         `if`(i<>h, add(b(n-i*j, i), j=2..n/i), 0), i=2..n/2))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..60);  # Alois P. Heinz, May 17 2022
  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!MemberQ[#,1]&&!MemberQ[Length/@Split[#],1]&]],{n,0,15}]

Extensions

a(41)-a(52) from Alois P. Heinz, May 17 2022

A353696 Numbers k such that the k-th composition in standard order (A066099) is empty, a singleton, or has run-lengths that are a consecutive subsequence that is already counted.

Original entry on oeis.org

0, 1, 2, 4, 8, 10, 16, 32, 43, 58, 64, 128, 256, 292, 349, 442, 512, 586, 676, 697, 826, 1024, 1210, 1338, 1393, 1394, 1396, 1594, 2048, 2186, 2234, 2618, 2696, 2785, 2786, 2792, 3130, 4096, 4282, 4410, 4666, 5178, 5569, 5570, 5572, 5576, 5584, 6202, 8192
Offset: 1

Views

Author

Gus Wiseman, May 22 2022

Keywords

Comments

First differs from the non-consecutive version A353431 in lacking 22318, corresponding to the binary word 101011100101110 and standard composition (2,2,1,1,3,2,1,1,2), whose run-lengths (2,2,1,1,2,1) are a subsequence but not a consecutive subsequence.
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 compositions begin:
    0: ()
    1: (1)
    2: (2)
    4: (3)
    8: (4)
   10: (2,2)
   16: (5)
   32: (6)
   43: (2,2,1,1)
   58: (1,1,2,2)
   64: (7)
  128: (8)
  256: (9)
  292: (3,3,3)
  349: (2,2,1,1,2,1)
  442: (1,2,1,1,2,2)
  512: (10)
  586: (3,3,2,2)
  676: (2,2,3,3)
  697: (2,2,1,1,3,1)
  826: (1,3,1,1,2,2)
		

Crossrefs

Non-recursive non-consecutive for partitions: A325755, counted by A325702.
Non-consecutive: A353431, counted by A353391.
Non-consecutive for partitions: A353393, counted by A353426.
Non-recursive non-consecutive: A353402, counted by A353390.
Counted by: A353430.
Non-recursive: A353432, counted by A353392.
A005811 counts runs in binary expansion.
A011782 counts compositions.
A066099 lists compositions in standard order, run-lengths A333769.
Statistics of standard compositions:
- Length is A000120, sum A070939.
- Runs are counted by A124767, distinct A351014.
- Subsequences are counted by A334299, contiguous A124770/A124771.
- Runs-resistance is A333628.
Classes of standard compositions:
- Partitions are A114994, strict A333255, multisets A225620, sets A333256.
- Runs are A272919, counted by A000005.
- Golomb rulers are A333222, counted by A169942.
- Anti-runs are A333489, counted by A003242.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    yoyQ[y_]:=Length[y]<=1||MemberQ[Join@@Table[Take[y,{i,j}],{i,Length[y]},{j,i,Length[y]}],Length/@Split[y]]&&yoyQ[Length/@Split[y]];
    Select[Range[0,1000],yoyQ[stc[#]]&]
Showing 1-7 of 7 results.