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.

A333767 Length of shortest run of zeros after a one in the binary expansion of n. a(0) = 0.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Apr 06 2020

Keywords

Examples

			The binary expansion of 148 is (1,0,0,1,0,1,0,0), so a(148) = 1.
		

Crossrefs

Positions of first appearances (ignoring index 0) are A000079.
Positions of terms > 0 are A022340.
Minimum prime index is A055396.
The maximum part minus 1 is given by A087117.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Compositions without 1's are A022340.
- Sum is A070939.
- Product is A124758.
- Runs are counted by A124767.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Runs-resistance is A333628.
- Maximum is A333766.
- Minimum is A333768.
- Weakly decreasing compositions are A114994.
- Weakly increasing compositions are A225620.
- Strictly decreasing compositions are A333255.
- Strictly increasing compositions are A333256.

Programs

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

Formula

For n > 0, a(n) = A333768(n) - 1.

A349153 Numbers k such that the k-th composition in standard order has sum equal to twice its reverse-alternating sum.

Original entry on oeis.org

0, 11, 12, 14, 133, 138, 143, 148, 155, 158, 160, 168, 179, 182, 188, 195, 198, 204, 208, 216, 227, 230, 236, 240, 248, 2057, 2066, 2071, 2077, 2084, 2091, 2094, 2101, 2106, 2111, 2120, 2131, 2134, 2140, 2149, 2154, 2159, 2164, 2171, 2174, 2192, 2211, 2214
Offset: 1

Views

Author

Gus Wiseman, Nov 17 2021

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.
The reverse-alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(k-i) y_i.

Examples

			The terms and corresponding compositions begin:
    0: ()
   11: (2,1,1)
   12: (1,3)
   14: (1,1,2)
  133: (5,2,1)
  138: (4,2,2)
  143: (4,1,1,1,1)
  148: (3,2,3)
  155: (3,1,2,1,1)
  158: (3,1,1,1,2)
  160: (2,6)
  168: (2,2,4)
  179: (2,1,3,1,1)
  182: (2,1,2,1,2)
  188: (2,1,1,1,3)
		

Crossrefs

These compositions are counted by A262977 up to 0's.
Except for 0, a subset of A345917.
The unreversed version is A348614.
The unreversed negative version is A349154.
The negative version is A349155.
A non-reverse unordered version is A349159, counted by A000712 up to 0's.
An unordered version is A349160, counted by A006330 up to 0's.
A003242 counts Carlitz compositions.
A011782 counts compositions.
A025047 counts alternating or wiggly compositions, complement A345192.
A034871, A097805, and A345197 count compositions by alternating sum.
A103919 counts partitions by alternating sum, reverse A344612.
A116406 counts compositions with alternating sum >=0, ranked by A345913.
A138364 counts compositions with alternating sum 0, ranked by A344619.
Statistics of standard compositions:
- The compositions themselves are the rows of A066099.
- Number of parts is given by A000120, distinct A334028.
- Sum and product of parts are given by A070939 and A124758.
- Maximum and minimum parts are given by A333766 and A333768.
- Heinz number is given by A333219.
Classes of standard compositions:
- Partitions and strict partitions are ranked by A114994 and A333256.
- Multisets and sets are ranked by A225620 and A333255.
- Strict and constant compositions are ranked by A233564 and A272919.
- Carlitz compositions are ranked by A333489, complement A348612.
- Alternating compositions are ranked by A345167, complement A345168.

Programs

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

A357138 Minimal run-length of the n-th composition in standard order; a(0) = 0.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Sep 18 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.

Examples

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

Crossrefs

See link for more sequences related to standard compositions.
The version for Heinz numbers of partitions is A051904, for parts A055396.
For parts instead of run-length we have A333768, maximal A333766.
The opposite (maximal) version is A357137.
For first instead of minimal we have A357180, last A357181.

Programs

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

A357181 Last run-length of the n-th composition in standard order.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Sep 24 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.

Examples

			Composition 87 in standard order is (2,2,1,1,1), so a(87) = 3.
		

Crossrefs

See link for sequences related to standard compositions.
For parts instead of run-lengths we have A001511, first A065120.
For Heinz numbers of partitions we have A071178, first A067029.
This is the last part of row n of A333769.
For maximal instead of last we have A357137, minimal A357138.
The first instead of last run-length is A357180.
A051903 gives maximal part of prime signature.
A061395 gives maximal prime index.
A124767 counts runs in standard compositions.
A286470 gives maximal difference of prime indices.
A333766 gives maximal part of standard composition, minimal A333768.
A353847 ranks run-sums of standard compositions.

Programs

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

A357708 Numbers k such that the k-th composition in standard order has sum equal to twice its maximum part.

Original entry on oeis.org

3, 10, 11, 13, 14, 36, 37, 38, 39, 41, 44, 50, 51, 52, 57, 60, 136, 137, 138, 139, 140, 141, 142, 143, 145, 152, 162, 163, 168, 177, 184, 196, 197, 198, 199, 200, 209, 216, 226, 227, 232, 241, 248, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539
Offset: 1

Views

Author

Gus Wiseman, Oct 14 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 and corresponding compositions begin:
    3: (1,1)
   10: (2,2)
   11: (2,1,1)
   13: (1,2,1)
   14: (1,1,2)
   36: (3,3)
   37: (3,2,1)
   38: (3,1,2)
   39: (3,1,1,1)
   41: (2,3,1)
   44: (2,1,3)
   50: (1,3,2)
   51: (1,3,1,1)
		

Crossrefs

See link for sequences related to standard compositions.
A066311 lists gapless numbers.
A124767 counts runs in standard compositions.
A333766 gives maximal part of standard compositions, minimal A333768.
A356844 ranks compositions with at least one 1.

Programs

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

A358138 Difference between maximum and minimum part in the n-th composition in standard order.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Oct 31 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.

Crossrefs

See link for sequences related to standard compositions.
The first and last parts are A065120 and A001511, difference A358135.
This is the maximum minus minimum part in row n of A066099.
The version for Heinz numbers of partitions is A243055.
The maximum and minimum parts are A333766 and A333768.
The partial sums of standard compositions are A358134, adjusted A242628.
A011782 counts compositions.
A351014 counts distinct runs in standard compositions.

Programs

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

Formula

a(n) = A333766(n) - A333768(n).

A349152 Standard composition numbers of compositions into divisors. Numbers k such that all parts of the k-th composition in standard order are divisors of the sum of parts.

Original entry on oeis.org

0, 1, 2, 3, 4, 7, 8, 10, 11, 13, 14, 15, 16, 31, 32, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63, 64, 127, 128, 136, 138, 139, 141, 142, 143, 162, 163, 168, 170, 171, 173, 174, 175, 177, 181, 182, 183, 184
Offset: 1

Views

Author

Gus Wiseman, Nov 15 2021

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 and corresponding compositions begin:
      0: ()              36: (3,3)           54: (1,2,1,2)
      1: (1)             37: (3,2,1)         55: (1,2,1,1,1)
      2: (2)             38: (3,1,2)         57: (1,1,3,1)
      3: (1,1)           39: (3,1,1,1)       58: (1,1,2,2)
      4: (3)             41: (2,3,1)         59: (1,1,2,1,1)
      7: (1,1,1)         42: (2,2,2)         60: (1,1,1,3)
      8: (4)             43: (2,2,1,1)       61: (1,1,1,2,1)
     10: (2,2)           44: (2,1,3)         62: (1,1,1,1,2)
     11: (2,1,1)         45: (2,1,2,1)       63: (1,1,1,1,1,1)
     13: (1,2,1)         46: (2,1,1,2)       64: (7)
     14: (1,1,2)         47: (2,1,1,1,1)    127: (1,1,1,1,1,1,1)
     15: (1,1,1,1)       50: (1,3,2)        128: (8)
     16: (5)             51: (1,3,1,1)      136: (4,4)
     31: (1,1,1,1,1)     52: (1,2,3)        138: (4,2,2)
     32: (6)             53: (1,2,2,1)      139: (4,2,1,1)
		

Crossrefs

Looking at length instead of parts gives A096199.
These composition are counted by A100346.
A version counting subsets instead of compositions is A125297.
An unordered version is A326841, counted by A018818.
A011782 counts compositions.
A316413 ranks partitions with sum divisible by length, counted by A067538.
A319333 ranks partitions with sum equal to lcm, counted by A074761.
Statistics of standard compositions:
- The compositions themselves are the rows of A066099.
- Number of parts is given by A000120, distinct A334028.
- Sum and product of parts are given by A070939 and A124758.
- Maximum and minimum parts are given by A333766 and A333768.
Classes of standard compositions:
- Partitions and strict partitions are ranked by A114994 and A333256.
- Multisets and sets are ranked by A225620 and A333255.
- Strict and constant compositions are ranked by A233564 and A272919.
- Permutations are ranked by A333218.
- Relatively prime compositions are ranked by A291166*, complement A291165.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,100],#==0||Divisible[Total[stc[#]],LCM@@stc[#]]&]
Previous Showing 11-17 of 17 results.