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-20 of 42 results. Next

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

A374251 Irregular triangle read by rows where row n is the run-compression of the n-th composition in standard order.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jul 09 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, run-compression removes all parts equal to the part immediately to their left. For example, (1,1,2,2,1) has run-compression (1,2,1).

Examples

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

Crossrefs

Last column is A001511.
First column is A065120.
Row-lengths are A124767.
Using prime indices we get A304038, row-sums A066328.
Row n has A334028(n) distinct elements.
Rows are ranked by A373948 (standard order).
Row-sums are A373953.
A003242 counts run-compressed compositions, i.e., anti-runs, ranks A333489.
A007947 (squarefree kernel) represents run-compression of multisets.
A037201 run-compresses first differences of primes, halved A373947.
A066099 lists the parts of compositions in standard order.
A116861 counts partitions by sum of run-compression.
A238279 and A333755 count compositions by number of runs.
A373949 counts compositions by sum of run-compression, opposite A373951.

Programs

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

A376305 Run-compression of the sequence of first differences of squarefree numbers.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Sep 20 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, run-compression removes all parts equal to the part immediately to their left. For example, (1,1,2,2,1) has run-compression (1,2,1).

Examples

			The sequence of squarefree numbers (A005117) is:
  1, 2, 3, 5, 6, 7, 10, 11, 13, 14, 15, 17, 19, 21, 22, 23, 26, 29, 30, ...
The sequence of first differences (A076259) of squarefree numbers is:
  1, 1, 2, 1, 1, 3, 1, 2, 1, 1, 2, 2, 2, 1, 1, 3, 3, 1, 1, 2, 1, 1, 2, 1, ...
The run-compression is A376305 (this sequence).
		

Crossrefs

This is the run-compression of first differences of A005117.
For prime instead of squarefree numbers we have A037201, halved A373947.
Before compressing we had A076259, ones A375927.
For run-lengths instead of compression we have A376306.
For run-sums instead of compression we have A376307.
For prime-powers instead of squarefree numbers we have A376308.
For positions of first appearances instead of compression we have A376311.
The version for nonsquarefree numbers is A376312.
Positions of 1's are A376342.
A000040 lists the prime numbers, differences A001223.
A000961 and A246655 list prime-powers, differences A057820.
A003242 counts compressed or anti-run compositions, ranks A333489.
A005117 lists squarefree numbers, differences A076259.
A013929 lists nonsquarefree numbers, differences A078147.
A116861 counts partitions by compressed sum, by compressed length A116608.
A274174 counts contiguous compositions, ranks A374249.

Programs

  • Mathematica
    First/@Split[Differences[Select[Range[100],SquareFreeQ]]]

A376312 Run-compression of first differences (A078147) of nonsquarefree numbers (A013929).

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Sep 24 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, we can remove all parts equal to the part immediately to their left. For example, (1,1,2,2,1) has run-compression (1,2,1).

Examples

			The sequence of nonsquarefree numbers (A013929) is:
  4, 8, 9, 12, 16, 18, 20, 24, 25, 27, 28, 32, 36, 40, 44, 45, 48, 49, 50, ...
with first differences (A078147):
  4, 1, 3, 4, 2, 2, 4, 1, 2, 1, 4, 4, 4, 4, 1, 3, 1, 1, 2, 2, 2, 4, 3, 1, ...
with runs:
  (4),(1),(3),(4),(2,2),(4),(1),(2),(1),(4,4,4,4),(1),(3),(1,1),(2,2,2), ...
and run-compression (A376312):
  4, 1, 3, 4, 2, 4, 1, 2, 1, 4, 1, 3, 1, 2, 4, 3, 1, 4, 3, 1, 4, 1, 3, 4, ...
		

Crossrefs

For nonprime instead of squarefree numbers we have A037201, halved A373947.
Before compressing we had A078147.
For run-sums instead of compression we have A376264.
For squarefree instead of nonsquarefree we have A376305, ones A376342.
For prime-powers instead of nonsquarefree numbers we have A376308.
A000040 lists the prime numbers, differences A001223.
A000961 and A246655 list prime-powers, differences A057820.
A003242 counts compressed compositions, ranks A333489.
A005117 lists squarefree numbers, differences A076259 (ones A375927).
A013929 lists nonsquarefree numbers, differences A078147.
A116861 counts partitions by compressed sum, by compressed length A116608.

Programs

  • Mathematica
    First/@Split[Differences[Select[Range[100], !SquareFreeQ[#]&]]]

A376340 Sorted positions of first appearances in A057820, the sequence of first differences of prime-powers.

Original entry on oeis.org

1, 4, 9, 12, 18, 24, 34, 47, 60, 79, 117, 178, 198, 206, 215, 244, 311, 402, 465, 614, 782, 1078, 1109, 1234, 1890, 1939, 1961, 2256, 2290, 3149, 3377, 3460, 3502, 3722, 3871, 4604, 4694, 6634, 8073, 8131, 8793, 12370, 12661, 14482, 14990, 15912, 17140, 19166
Offset: 1

Views

Author

Gus Wiseman, Sep 22 2024

Keywords

Examples

			The terms together with their prime indices begin:
     1: {}
     4: {1,1}
     9: {2,2}
    12: {1,1,2}
    18: {1,2,2}
    24: {1,1,1,2}
    34: {1,7}
    47: {15}
    60: {1,1,2,3}
    79: {22}
   117: {2,2,6}
   178: {1,24}
   198: {1,2,2,5}
   206: {1,27}
   215: {3,14}
   244: {1,1,18}
		

Crossrefs

For compression instead of sorted firsts we have A376308.
For run-lengths instead of sorted firsts we have A376309.
For run-sums instead of sorted firsts we have A376310.
The version for squarefree numbers is the unsorted version of A376311.
The unsorted version is A376341.
A000040 lists the prime numbers, differences A001223.
A000961 and A246655 list prime-powers, first differences A057820.
A003242 counts compressed compositions, ranks A333489.
A005117 lists squarefree numbers, differences A076259.
A024619 and A361102 list non-prime-powers, first differences A375708.
A116861 counts partitions by compressed sum, by compressed length A116608.

Programs

  • Mathematica
    q=Differences[Select[Range[100],PrimePowerQ]];
    Select[Range[Length[q]],!MemberQ[Take[q,#-1],q[[#]]]&]

A373821 Run-lengths of run-lengths of first differences of odd primes.

Original entry on oeis.org

1, 11, 1, 19, 1, 1, 1, 5, 1, 6, 1, 16, 1, 27, 1, 3, 1, 1, 1, 6, 1, 9, 1, 29, 1, 2, 1, 18, 1, 1, 1, 5, 1, 3, 1, 17, 1, 19, 1, 30, 1, 17, 1, 46, 1, 17, 1, 27, 1, 30, 1, 5, 1, 36, 1, 41, 1, 10, 1, 31, 1, 44, 1, 4, 1, 14, 1, 6, 1, 2, 1, 32, 1, 13, 1, 17, 1, 5
Offset: 1

Views

Author

Gus Wiseman, Jun 22 2024

Keywords

Comments

Run-lengths of A333254.
The first term other than 1 at an odd positions is at a(101) = 2.
Also run-lengths (differing by 0) of run-lengths (differing by 0) of run-lengths (differing by 1) of composite numbers.

Examples

			The odd primes are:
3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, ...
with first differences:
2, 2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 6, 2, 6, 4, 2, 6, 4, 6, 8, ...
with run-lengths:
2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, ...
with run-lengths a(n).
		

Crossrefs

Run-lengths of run-lengths of A046933(n) = A001223(n) - 1.
Run-lengths of A333254.
A000040 lists the primes.
A001223 gives differences of consecutive primes.
A027833 gives antirun lengths of odd primes (partial sums A029707).
A065855 counts composite numbers up to n.
A071148 gives partial sums of odd primes.
A373820 gives run-lengths of antirun-lengths of odd primes.
For prime runs: A001359, A006512, A025584, A067774, A373406.
For composite runs: A005381, A008864, A054265, A176246, A251092, A373403.

Programs

  • Mathematica
    Length/@Split[Length /@ Split[Differences[Select[Range[3,1000],PrimeQ]]]//Most]//Most

A373947 Halved and run-compressed first differences of consecutive odd primes.

Original entry on oeis.org

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

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, run-compression removes all parts equal to the part immediately to their left. For example, (1,1,2,2,1) has run-compression (1,2,1).

Examples

			The odd primes begin:
3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, ...
with differences:
2, 2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, ...
with run-compression:
2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 4, ...
which is 2*a(n).
		

Crossrefs

Programs

  • Mathematica
    First/@Split[Differences[Select[Range[3,100],PrimeQ]]]/2

Formula

a(n) = A037201(n+1)/2.

A376308 Run-compression of the sequence of first differences of prime-powers.

Original entry on oeis.org

1, 2, 1, 2, 3, 1, 2, 4, 2, 1, 5, 4, 2, 4, 2, 4, 6, 2, 3, 4, 2, 6, 2, 6, 8, 4, 2, 4, 2, 4, 8, 4, 2, 1, 3, 6, 2, 10, 2, 6, 4, 2, 4, 6, 2, 10, 2, 4, 2, 12, 4, 2, 4, 6, 2, 8, 5, 1, 6, 2, 6, 4, 2, 6, 4, 14, 4, 2, 4, 14, 6, 4, 2, 4, 6, 2, 6, 4, 6, 8, 4, 8, 10, 2, 10
Offset: 1

Views

Author

Gus Wiseman, Sep 20 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, run-compression removes all parts equal to the part immediately to their left. For example, (1,1,2,2,1) has run-compression (1,2,1).

Examples

			The sequence of prime-powers (A246655) is:
  2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 23, 25, 27, 29, 31, 32, 37, ...
The sequence of first differences (A057820) of prime-powers is:
  1, 1, 1, 2, 1, 1, 2, 2, 3, 1, 2, 4, 2, 2, 2, 2, 1, 5, 4, 2, 4, 2, 4, ...
The run-compression is A376308 (this sequence).
		

Crossrefs

For primes instead of prime-powers we have A037201, halved A373947.
For squarefree numbers instead of prime-powers we have A376305.
For run-lengths instead of compression we have A376309.
For run-sums instead of compression we have A376310.
For positions of first appearances we have A376341, sorted A376340.
A000040 lists the prime numbers, differences A001223.
A000961 and A246655 list prime-powers, differences A057820.
A003242 counts compressed compositions, ranks A333489.
A024619 and A361102 list non-prime-powers, differences A375708.
A116861 counts partitions by compressed sum, by compressed length A116608.
A373948 encodes compression using compositions in standard order.

Programs

  • Mathematica
    First/@Split[Differences[Select[Range[100],PrimePowerQ]]]

A373820 Run-lengths (differing by 0) of antirun-lengths (differing by > 2) of odd primes.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jun 22 2024

Keywords

Comments

Run-lengths of the version of A027833 with 1 prepended.

Examples

			The antiruns of odd primes (differing by > 2) begin:
   3
   5
   7  11
  13  17
  19  23  29
  31  37  41
  43  47  53  59
  61  67  71
  73  79  83  89  97 101
 103 107
 109 113 127 131 137
 139 149
 151 157 163 167 173 179
 181 191
 193 197
 199 211 223 227
 229 233 239
 241 251 257 263 269
 271 277 281
with lengths:
1, 1, 2, 2, 3, 3, 4, 3, 6, 2, 5, 2, 6, 2, 2, ...
with runs:
  1  1
  2  2
  3  3
  4
  3
  6
  2
  5
  2
  6
  2  2
  4
  3
  5
  3
  4
with lengths a(n).
		

Crossrefs

Run-lengths of A027833 (if we prepend 1), partial sums A029707.
For runs we have A373819, run-lengths of A251092.
Positions of first appearances are A373827, sorted A373826.
A000040 lists the primes.
A001223 gives differences of consecutive primes, run-lengths A333254, run-lengths of run-lengths A373821.
A046933 counts composite numbers between primes.
A065855 counts composite numbers up to n.
A071148 gives partial sums of odd primes.
For composite runs: A005381, A054265, A068780, A373403, A373404.

Programs

  • Mathematica
    Length/@Split[Length/@Split[Select[Range[3,1000],PrimeQ],#2-#1>2&]//Most]//Most
Previous Showing 11-20 of 42 results. Next