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.

Previous Showing 11-17 of 17 results.

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[#]]&]

A353432 Numbers k such that the k-th composition in standard order has its own run-lengths as a consecutive subsequence.

Original entry on oeis.org

0, 1, 10, 21, 26, 43, 58, 107, 117, 174, 186, 292, 314, 346, 348, 349, 373, 430, 442, 570, 585, 586, 629, 676, 696, 697, 804, 826, 860, 861, 885, 1082, 1141, 1173, 1210, 1338, 1387, 1392, 1393, 1394, 1396, 1594, 1653, 1700, 1720, 1721, 1882, 2106, 2165, 2186
Offset: 1

Views

Author

Gus Wiseman, May 16 2022

Keywords

Comments

First differs from A353402 (the non-consecutive version) in lacking 53.
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)
    10:       1010  (2,2)
    21:      10101  (2,2,1)
    26:      11010  (1,2,2)
    43:     101011  (2,2,1,1)
    58:     111010  (1,1,2,2)
   107:    1101011  (1,2,2,1,1)
   117:    1110101  (1,1,2,2,1)
   174:   10101110  (2,2,1,1,2)
   186:   10111010  (2,1,1,2,2)
   292:  100100100  (3,3,3)
   314:  100111010  (3,1,1,2,2)
   346:  101011010  (2,2,1,2,2)
   348:  101011100  (2,2,1,1,3)
   349:  101011101  (2,2,1,1,2,1)
   373:  101110101  (2,1,1,2,2,1)
   430:  110101110  (1,2,2,1,1,2)
   442:  110111010  (1,2,1,1,2,2)
		

Crossrefs

These compositions are counted by A353392.
This is the consecutive case of A353402, counted by A353390.
The non-consecutive recursive version is A353431, counted by A353391.
The recursive version 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, strict A333255, rev A225620, strict rev 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;
    rorQ[y_]:=Length[y]==0||MemberQ[Join@@Table[Take[y,{i,j}],{i,Length[y]},{j,i,Length[y]}],Length/@Split[y]];
    Select[Range[0,10000],rorQ[stc[#]]&]

A335550 Number of minimal normal patterns avoided by the prime indices of n in increasing or decreasing order, counting multiplicity.

Original entry on oeis.org

1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, 4, 3, 4, 3, 3, 3, 4, 3, 3, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 3, 4, 4, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 3, 3, 4, 3, 3, 4, 3, 3, 3, 3, 4, 3, 3
Offset: 1

Views

Author

Gus Wiseman, Jun 26 2020

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
We define a (normal) pattern to be a finite sequence covering an initial interval of positive integers. Patterns are counted by A000670 and ranked by A333217. A sequence S is said to match a pattern P if there is a not necessarily contiguous subsequence of S whose parts have the same relative order as P. For example, (3,1,1,3) matches (1,1,2), (2,1,1), and (2,1,2), but avoids (1,2,1), (1,2,2), and (2,2,1).

Examples

			The a(12) = 4 minimal patterns avoiding (1,1,2) are: (2,1), (1,1,1), (1,2,2), (1,2,3).
The a(30) = 3 minimal patterns avoiding (1,2,3) are: (1,1), (2,1), (1,2,3,4).
		

Crossrefs

The version for standard compositions is A335465.
Patterns are counted by A000670.
Sum of prime indices is A056239.
Each number's prime indices are given in the rows of A112798.
Patterns are ranked by A333217.
Patterns matched by compositions are counted by A335456.
Patterns matched by prime indices are counted by A335549.
Patterns matched by partitions are counted by A335837.

Formula

It appears that for n > 1, a(n) = 3 if n is a power of a squarefree number (A072774), and a(n) = 4 otherwise.

A334300 Number of distinct nonempty subsequences (not necessarily contiguous) in the n-th composition in standard order (A066099).

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jun 01 2020

Keywords

Comments

Looking only at contiguous subsequences, or restrictions to a subinterval, gives A124770.
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:
  1
  1 2
  1 3 3 3
  1 3 2 5 3 6 5 4
  1 3 3 5 3 5 6 7 3 6 5 9 5 9 7 5
If the k-th composition in standard order is c, then we say that the STC-number of c is k. The n-th column below lists the STC-numbers of the nonempty subsequences of the composition with STC-number n:
  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15
        1     2  2  3     4   2   5   4   6   6   7
              1  1  1     1       3   1   5   3   3
                                  2       3   2   1
                                  1       2   1
                                          1
		

Crossrefs

Row lengths are A011782.
Looking only at contiguous subsequences gives A124770.
The contiguous case with empty subsequences allowed is A124771.
Allowing empty subsequences gives A334299.
Compositions where every subinterval has a different sum are A333222.
Knapsack compositions are A333223.
Contiguous positive subsequence-sums are counted by A333224.
Contiguous subsequence-sums are counted by A333257.
Subsequence-sums are counted by A334968.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Length[Union[Rest[Subsets[stc[n]]]]],{n,0,100}]
  • Python
    from itertools import combinations
    def comp(n):
        # see A357625
        return
    def A334300(n):
        A,C = set(),comp(n)
        c = range(len(C))
        for j in c:
            for k in combinations(c, j):
                A.add(tuple(C[i] for i in k))
        return len(A) # John Tyler Rascoe, Mar 12 2025

Formula

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

A335474 Number of nonempty normal patterns contiguously matched by the n-th composition in standard order.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jun 21 2020

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 a (normal) pattern to be a finite sequence covering an initial interval of positive integers. Patterns are counted by A000670 and ranked by A333217. A sequence S is said to match a pattern P if there is a not necessarily contiguous subsequence of S whose parts have the same relative order as P. For example, (3,1,1,3) matches (1,1,2), (2,1,1), and (2,1,2), but avoids (1,2,1), (1,2,2), and (2,2,1).

Examples

			The a(n) patterns for n = 32, 80, 133, 290, 305, 329, 436 are:
      (1)  (1)   (1)    (1)    (1)     (1)     (1)
           (12)  (21)   (12)   (12)    (11)    (12)
                 (321)  (21)   (21)    (12)    (21)
                        (231)  (121)   (21)    (121)
                               (213)   (122)   (123)
                               (2131)  (221)   (212)
                                       (2331)  (1212)
                                               (2123)
                                               (12123)
		

Crossrefs

The version for Heinz numbers of partitions is A335516(n) - 1.
The non-contiguous version is A335454(n) - 1.
The version allowing empty patterns is A335458.
Patterns are counted by A000670 and ranked by A333217.
The n-th composition has A124771(n) distinct consecutive subsequences.
Knapsack compositions are counted by A325676 and ranked by A333223.
The n-th composition has A334299(n) distinct subsequences.
Minimal avoided patterns are counted by A335465.
Patterns matched by prime indices are counted by A335549.

Programs

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

Formula

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

A335279 Positions of first appearances in A124771 = number of distinct contiguous subsequences of compositions in standard order.

Original entry on oeis.org

0, 1, 3, 5, 11, 15, 23, 27, 37, 47, 55, 107, 111, 119, 155, 215, 223, 239, 411, 431, 471, 479, 495, 549, 631, 943, 951, 959, 991, 1647, 1887, 1967, 1983, 2015, 2543, 2935, 3703, 3807, 3935, 3967, 4031, 6639, 6895, 7407, 7871, 7903, 8063, 8127, 10207, 13279
Offset: 1

Views

Author

Gus Wiseman, Jun 03 2020

Keywords

Examples

			The sequence together with the corresponding compositions begins:
     0: ()                215: (1,2,2,1,1,1)
     1: (1)               223: (1,2,1,1,1,1,1)
     3: (1,1)             239: (1,1,2,1,1,1,1)
     5: (2,1)             411: (1,3,1,2,1,1)
    11: (2,1,1)           431: (1,2,2,1,1,1,1)
    15: (1,1,1,1)         471: (1,1,2,2,1,1,1)
    23: (2,1,1,1)         479: (1,1,2,1,1,1,1,1)
    27: (1,2,1,1)         495: (1,1,1,2,1,1,1,1)
    37: (3,2,1)           549: (4,3,2,1)
    47: (2,1,1,1,1)       631: (3,1,1,2,1,1,1)
    55: (1,2,1,1,1)       943: (1,1,2,2,1,1,1,1)
   107: (1,2,2,1,1)       951: (1,1,2,1,2,1,1,1)
   111: (1,2,1,1,1,1)     959: (1,1,2,1,1,1,1,1,1)
   119: (1,1,2,1,1,1)     991: (1,1,1,2,1,1,1,1,1)
   155: (3,1,2,1,1)      1647: (1,3,1,2,1,1,1,1)
The subsequences for n = 0, 1, 3, 5, 11, 15, 23, 27 are the following (0 = empty partition):
  0  0  0   0   0    0     0     0     0    0
     1  1   1   1    1     1     1     1    1
        11  2   2    11    2     2     2    2
            21  11   111   11    11    3    11
                21   1111  21    12    21   21
                211        111   21    32   111
                           211   121   321  211
                           2111  211        1111
                                 1211       2111
                                            21111
		

Crossrefs

Positions of first appearances in A124771.
Compositions where every subinterval has a different sum are A333222.
Knapsack compositions are A333223.

Programs

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

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[#]]&]
Previous Showing 11-17 of 17 results.