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-10 of 33 results. Next

A384175 Number of subsets of {1..n} with all distinct lengths of maximal runs (increasing by 1).

Original entry on oeis.org

1, 2, 4, 7, 13, 24, 44, 77, 135, 236, 412, 713, 1215, 2048, 3434, 5739, 9559, 15850, 26086, 42605, 69133, 111634, 179602, 288069, 460553, 733370, 1162356, 1833371, 2878621, 4501856, 7016844, 10905449, 16904399, 26132460, 40279108, 61885621, 94766071, 144637928
Offset: 0

Views

Author

Gus Wiseman, Jun 16 2025

Keywords

Examples

			The subset {2,3,5,6,7,9} has maximal runs ((2,3),(5,6,7),(9)), with lengths (2,3,1), so is counted under a(9).
The a(0) = 1 through a(4) = 13 subsets:
  {}  {}   {}     {}       {}
      {1}  {1}    {1}      {1}
           {2}    {2}      {2}
           {1,2}  {3}      {3}
                  {1,2}    {4}
                  {2,3}    {1,2}
                  {1,2,3}  {2,3}
                           {3,4}
                           {1,2,3}
                           {1,2,4}
                           {1,3,4}
                           {2,3,4}
                           {1,2,3,4}
		

Crossrefs

For equal instead of distinct lengths we have A243815.
These subsets are ranked by A328592.
The complement is counted by A384176.
For anti-runs instead of runs we have A384177, ranks A384879.
For partitions instead of subsets we have A384884, A384178, A384886, A384880.
For permutations instead of subsets we have A384891, equal instead of distinct A384892.
A034839 counts subsets by number of maximal runs, for strict partitions A116674.
A098859 counts Wilf partitions (distinct multiplicities), complement A336866.
A384893 counts subsets by number of maximal anti-runs, for partitions A268193, A384905.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],UnsameQ@@Length/@Split[#,#2==#1+1&]&]],{n,0,10}]
  • PARI
    lista(n)={my(o=(1-x^(n+1))/(1-x)*O(y^(n+2)),p=prod(i=1,n,1+o+x*y^(i+1)/(1-y),1/(1-y)));p=subst(serlaplace(p),x,1);Vec(p-1)} \\ Christian Sievers, Jun 18 2025

Extensions

a(21) and beyond from Christian Sievers, Jun 18 2025

A384177 Number of subsets of {1..n} with all distinct lengths of maximal anti-runs (increasing by more than 1).

Original entry on oeis.org

1, 2, 3, 5, 10, 19, 35, 62, 109, 197, 364, 677, 1251, 2288, 4143, 7443, 13318, 23837, 42809, 77216, 139751, 253293, 458800, 829237, 1494169, 2683316, 4804083, 8580293, 15301324, 27270061, 48607667, 86696300, 154758265, 276453311, 494050894, 882923051
Offset: 0

Views

Author

Gus Wiseman, Jun 16 2025

Keywords

Examples

			The subset {1,2,4,5,7,10} has maximal anti-runs ((1),(2,4),(5,7,10)), with lengths (1,2,3), so is counted under a(10).
The a(0) = 1 through a(5) = 19 subsets:
  {}  {}   {}   {}     {}       {}
      {1}  {1}  {1}    {1}      {1}
           {2}  {2}    {2}      {2}
                {3}    {3}      {3}
                {1,3}  {4}      {4}
                       {1,3}    {5}
                       {1,4}    {1,3}
                       {2,4}    {1,4}
                       {1,2,4}  {1,5}
                       {1,3,4}  {2,4}
                                {2,5}
                                {3,5}
                                {1,2,4}
                                {1,2,5}
                                {1,3,4}
                                {1,3,5}
                                {1,4,5}
                                {2,3,5}
                                {2,4,5}
		

Crossrefs

For runs instead of anti-runs we have A384175, complement A384176.
These subsets are ranked by A384879.
For strict partitions instead of subsets we have A384880, see A384178, A384884, A384886.
For equal instead of distinct lengths we have A384889, for runs A243815.
A034839 counts subsets by number of maximal runs, for strict partitions A116674.
A098859 counts Wilf partitions (distinct multiplicities), complement A336866.
A384893 counts subsets by number of maximal anti-runs, for partitions A268193, A384905.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],UnsameQ@@Length/@Split[#,#2!=#1+1&]&]],{n,0,10}]
  • PARI
    lista(n)={my(o=(1-x^(n+1))/(1-x)*O(y*y^n),p=prod(i=1,(n+1)\2,1+o+x*y^(2*i-1)/(1-y)^(i-1)));p=subst(serlaplace(p),x,1);Vec((p-y)/(1-y)^2)} \\ Christian Sievers, Jun 18 2025

Extensions

a(21) and beyond from Christian Sievers, Jun 18 2025

A384877 Irregular triangle read by rows where row k lists the lengths of maximal anti-runs (increasing by more than 1) in the binary indices of n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jun 17 2025

Keywords

Comments

A binary index of n is any position of a 1 in its reversed binary expansion. The binary indices of n are row n of A048793.

Examples

			The binary indices of 182 are {2,3,5,6,8}, with maximal anti-runs ((2),(3,5),(6,8)) so row 182 is (1,2,2).
Triangle begins:
   0: ()
   1: (1)
   2: (1)
   3: (1,1)
   4: (1)
   5: (2)
   6: (1,1)
   7: (1,1,1)
   8: (1)
   9: (2)
  10: (2)
  11: (1,2)
  12: (1,1)
  13: (2,1)
  14: (1,1,1)
  15: (1,1,1,1)
		

Crossrefs

Row-sums are A000120.
Positions of rows of the form (1,1,...) are A023758.
Positions of first appearances of each distinct row appear to be A052499.
For runs instead of anti-runs we have A245563, reverse A245562.
Row-lengths are A384890.
A355394 counts partitions without a neighborless part, singleton case A355393.
A356606 counts strict partitions without a neighborless part, complement A356607.
A384175 counts subsets with all distinct lengths of maximal runs, complement A384176.

Programs

  • Mathematica
    bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    Table[Length/@Split[bpe[n],#2!=#1+1&],{n,0,100}]

A384890 Number of maximal anti-runs (increasing by more than 1) in the binary indices of n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jun 17 2025

Keywords

Comments

First differs from A272604 at a(51) = 3, A272604(51) = 2.
A binary index of n is any position of a 1 in its reversed binary expansion. The binary indices of n are row n of A048793.
Do all constant runs in this sequence have lengths 1, 2, or 3?

Examples

			The binary indices of 51 are {1,2,5,6}, with maximal anti-runs ((1),(2,5),(6)), so a(51) = 3.
		

Crossrefs

For runs instead of anti-runs we have A069010 = run-lengths of A245563 (reverse A245562).
Row-lengths of A384877, firsts A384878.
For prime indices instead of binary indices we have A384906.
A000120 counts binary indices.
A356606 counts strict partitions without a neighborless part, complement A356607.
A384175 counts subsets with all distinct lengths of maximal runs, complement A384176.

Programs

  • Mathematica
    bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    Table[Length[Split[bpe[n],#2!=#1+1&]],{n,0,100}]

A384176 Number of subsets of {1..n} without all distinct lengths of maximal runs (increasing by 1).

Original entry on oeis.org

0, 0, 0, 1, 3, 8, 20, 51, 121, 276, 612, 1335, 2881, 6144, 12950, 27029, 55977, 115222, 236058, 481683, 979443
Offset: 0

Views

Author

Gus Wiseman, Jun 16 2025

Keywords

Examples

			The subset {1,3,4,8,9} has maximal runs ((1),(3,4),(8,9)), with lengths (1,2,2), so is counted under a(10).
The a(0) = 0 through a(6) = 20 subsets:
  .  .  .  {1,3}  {1,3}  {1,3}      {1,3}
                  {1,4}  {1,4}      {1,4}
                  {2,4}  {1,5}      {1,5}
                         {2,4}      {1,6}
                         {2,5}      {2,4}
                         {3,5}      {2,5}
                         {1,3,5}    {2,6}
                         {1,2,4,5}  {3,5}
                                    {3,6}
                                    {4,6}
                                    {1,3,5}
                                    {1,3,6}
                                    {1,4,6}
                                    {2,4,6}
                                    {1,2,4,5}
                                    {1,2,4,6}
                                    {1,2,5,6}
                                    {1,3,4,6}
                                    {1,3,5,6}
                                    {2,3,5,6}
		

Crossrefs

For equal instead of distinct lengths the complement is A243815.
These subsets are ranked by the non-members of A328592.
The complement is counted by A384175.
For strict partitions instead of subsets see A384178, A384884, A384886, A384880.
For permutations instead of subsets see A384891, A384892, A010027.
A034839 counts subsets by number of maximal runs, for strict partitions A116674.
A098859 counts Wilf partitions (distinct multiplicities), complement A336866.
A384893 counts subsets by number of maximal anti-runs, for partitions A268193, A384905.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],!UnsameQ@@Length/@Split[#,#2==#1+1&]&]],{n,0,10}]

A384878 Position of first appearance of n in the flattened version of the triangle A384877, whose m-th row lists the lengths of maximal anti-runs in the binary indices of m.

Original entry on oeis.org

1, 6, 34, 178, 882, 4210, 19570, 89202, 400498, 1776754
Offset: 1

Views

Author

Gus Wiseman, Jun 23 2025

Keywords

Comments

A binary index of n is any position of a 1 in its reversed binary expansion. The binary indices of n are row n of A048793.

Examples

			The set of binary indices of each nonnegative integer and its partition into anti-runs begins:
  0: {}      {{}}
  1: {1}     {{1}}
  2: {2}     {{2}}
  3: {1,2}   {{1},{2}}
  4: {3}     {{3}}
  5: {1,3}   {{1,3}}
  6: {2,3}   {{2},{3}}
  7: {1,2,3} {{1},{2},{3}}
The flattened version begins: {}, {1}, {2}, {1}, {2}, {3}, {1,3}, {2}, {3}, {1}, {2}, {3}. Of these sets, the first of length 2 is the sixth (starting with 0), so we have a(2) = 6.
		

Crossrefs

For runs instead of anti-runs we have A001792.
The unflattened version is A052499.
Positions of first appearances in A384877, see A000120, A245562, A245563, A384890.
A023758 lists differences of powers of 2.
A384175 counts subsets with all distinct lengths of maximal runs, complement A384176.

Programs

  • Mathematica
    bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    mnrm[s_]:=If[Min@@s==1,mnrm[DeleteCases[s-1,0]]+1,0];
    q=Join@@Table[Length/@Split[bpe[n],#2!=#1+1&],{n,0,100}];
    Table[Position[q,i][[1,1]],{i,mnrm[q]}]

A200649 Number of 1's in the Stolarsky representation of n.

Original entry on oeis.org

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

Views

Author

Casey Mongoven, Nov 19 2011

Keywords

Comments

For the Stolarsky representation of n, see the C. Mongoven link.
Conjecture: a(n) is the length of row n-1 of A385886. To obtain it, first take maximal anti-run lengths of binary indices of each nonnegative integer (giving A384877), then remove all duplicate rows (giving A385886), and finally take the length of each remaining row. For sum instead of length we appear to have A200648. For runs minus 1 instead of anti-runs see A200650. - Gus Wiseman, Jul 21 2025

Examples

			The Stolarsky representation of 19 is 11101. This has 4 1's. So a(19) = 4.
		

Crossrefs

For length instead of number of 1's we have A200648.
For 0's instead of 1's we have A200650.
Stolarsky representation is listed by A385888, ranks A200714.
A000120 counts 1's in binary expansion.
A384877 lists anti-run lengths of binary indices, duplicates removed A385886.
A384890 counts maximal anti-runs of binary indices, ranked by A385816.

Programs

  • Mathematica
    stol[n_] := stol[n] = If[n == 1, {}, If[n != Round[Round[n/GoldenRatio]*GoldenRatio], Join[stol[Floor[n/GoldenRatio^2] + 1], {0}], Join[stol[Round[n/GoldenRatio]], {1}]]];
    a[n_] := Count[stol[n], 1]; Array[a, 100] (* Amiram Eldar, Jul 07 2023 *)
  • PARI
    stol(n) = {my(phi=quadgen(5)); if(n==1, [], if(n != round(round(n/phi)*phi), concat(stol(floor(n/phi^2) + 1), [0]), concat(stol(round(n/phi)), [1])));}
    a(n) = vecsum(stol(n)); \\ Amiram Eldar, Jul 07 2023

Formula

a(n) = a(n - A130312(n-1)) + (A072649(n-1) - A072649(n - A130312(n-1) - 1)) mod 2 for n > 2 with a(1) = 0, a(2) = 1. - Mikhail Kurkov, Oct 19 2021 [verification needed]
a(n) = A200648(n) - A200650(n). - Amiram Eldar, Jul 07 2023

Extensions

More terms from Amiram Eldar, Jul 07 2023

A243815 Number of length n words on alphabet {0,1} such that the length of every maximal block of 0's (runs) is the same.

Original entry on oeis.org

1, 2, 4, 8, 14, 24, 39, 62, 97, 151, 233, 360, 557, 864, 1344, 2099, 3290, 5176, 8169, 12931, 20524, 32654, 52060, 83149, 133012, 213069, 341718, 548614, 881572, 1417722, 2281517, 3673830, 5918958, 9540577, 15384490, 24817031, 40045768, 64637963, 104358789
Offset: 0

Views

Author

Geoffrey Critzer, Jun 11 2014

Keywords

Comments

Number of terms of A164710 with exactly n+1 binary digits. - Robert Israel, Nov 09 2015
From Gus Wiseman, Jun 23 2025: (Start)
This is the number of subsets of {1..n} with all equal lengths of runs of consecutive elements increasing by 1. For example, the runs of S = {1,2,5,6,8,9} are ((1,2),(5,6),(8,9)), with lengths (2,2,2), so S is counted under a(9). The a(0) = 1 through a(4) = 14 subsets are:
{} {} {} {} {}
{1} {1} {1} {1}
{2} {2} {2}
{1,2} {3} {3}
{1,2} {4}
{1,3} {1,2}
{2,3} {1,3}
{1,2,3} {1,4}
{2,3}
{2,4}
{3,4}
{1,2,3}
{2,3,4}
{1,2,3,4}
(End)

Examples

			0110 is a "good" word because the length of both its runs of 0's is 1.
Words of the form 11...1 are good words because the condition is vacuously satisfied.
a(5) = 24 because there are 32 length 5 binary words but we do not count: 00010, 00101, 00110, 01000, 01001, 01100, 10010, 10100.
		

Crossrefs

Cf. A164710.
These subsets are ranked by A164707, complement A164708.
For distinct instead of equal lengths we have A384175, complement A384176.
For anti-runs instead of runs we have A384889, for partitions A384888.
For permutations instead of subsets we have A384892, distinct instead of equal A384891.
For partitions instead of subsets we have A384904, strict A384886.
The complement is counted by A385214.
A034839 counts subsets by number of maximal runs, for strict partitions A116674.
A049988 counts partitions with equal run-lengths, distinct A325325.
A329738 counts compositions with equal run-lengths, distinct A329739.
A384887 counts partitions with equal lengths of gapless runs, distinct A384884.

Programs

  • Maple
    a:= n-> 1 + add(add((d-> binomial(d+j, d))(n-(i*j-1))
              , j=1..iquo(n+1, i)), i=2..n+1):
    seq(a(n), n=0..50);  # Alois P. Heinz, Jun 11 2014
  • Mathematica
    nn=30;Prepend[Map[Total,Transpose[Table[Drop[CoefficientList[Series[ (1+x^k)/(1-x-x^(k+1))-1/(1-x),{x,0,nn}],x],1],{k,1,nn}]]],0]+1
    Table[Length[Select[Subsets[Range[n]],SameQ@@Length/@Split[#,#2==#1+1&]&]],{n,0,10}] (* Gus Wiseman, Jun 23 2025 *)

A200648 Length of Stolarsky representation of n.

Original entry on oeis.org

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

Views

Author

Casey Mongoven, Nov 19 2011

Keywords

Comments

For the Stolarsky representation of n, see the C. Mongoven link.
Conjecture: a(n) is the sum of row n-1 of A385886. To obtain it, first take maximal anti-run lengths of binary indices of each nonnegative integer (giving A384877), then remove all duplicate rows (giving A385886), and finally take the sum of each remaining row. For length instead of sum we appear to have A200649. - Gus Wiseman, Jul 21 2025

Examples

			The Stolarsky representation of 19 is 11101. This is of length 5. So a(19) = 5.
		

Crossrefs

Counting just ones gives A200649.
Counting just zeros gives A200650.
Stolarsky representation is listed by A385888, ranks A200714.
A000120 counts 1's in binary expansion.
A384890 counts maximal anti-runs of binary indices, ranks A385816.
A385886 lists maximal anti-run lengths of binary indices.

Programs

  • Mathematica
    stol[n_] := stol[n] = If[n == 1, {}, If[n != Round[Round[n/GoldenRatio]*GoldenRatio], Join[stol[Floor[n/GoldenRatio^2] + 1], {0}], Join[stol[Round[n/GoldenRatio]], {1}]]];
    a[n_] := If[n == 1, 1, Length[stol[n]]]; Array[a, 100] (* Amiram Eldar, Jul 07 2023 *)
  • PARI
    stol(n) = {my(phi=quadgen(5)); if(n==1, [], if(n != round(round(n/phi)*phi), concat(stol(floor(n/phi^2) + 1), [0]), concat(stol(round(n/phi)), [1])));}
    a(n) = if(n == 1, 1, #stol(n)); \\ Amiram Eldar, Jul 07 2023

Formula

a(n) = A200649(n) + A200650(n). - Michel Marcus, Mar 14 2023

Extensions

More terms from Amiram Eldar, Jul 07 2023

A384879 Numbers whose binary indices have all distinct lengths of maximal anti-runs (increasing by more than 1).

Original entry on oeis.org

1, 2, 4, 5, 8, 9, 10, 11, 13, 16, 17, 18, 19, 20, 21, 22, 25, 26, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44, 49, 50, 52, 53, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 76, 80, 81, 82, 83, 84, 85, 86, 88, 97, 98, 100, 101, 104, 105, 106, 128, 129, 130
Offset: 1

Views

Author

Gus Wiseman, Jun 17 2025

Keywords

Comments

A binary index of n is any position of a 1 in its reversed binary expansion. The binary indices of n are row n of A048793.

Examples

			The binary indices of 813 are {1,3,4,6,9,10}, with maximal anti-runs ((1,3),(4,6,9),(10)), with lengths (2,3,1), so 813 is in the sequence.
The terms together with their binary expansions and binary indices begin:
    1:       1 ~ {1}
    2:      10 ~ {2}
    4:     100 ~ {3}
    5:     101 ~ {1,3}
    8:    1000 ~ {4}
    9:    1001 ~ {1,4}
   10:    1010 ~ {2,4}
   11:    1011 ~ {1,2,4}
   13:    1101 ~ {1,3,4}
   16:   10000 ~ {5}
   17:   10001 ~ {1,5}
   18:   10010 ~ {2,5}
   19:   10011 ~ {1,2,5}
   20:   10100 ~ {3,5}
   21:   10101 ~ {1,3,5}
   22:   10110 ~ {2,3,5}
   25:   11001 ~ {1,4,5}
   26:   11010 ~ {2,4,5}
		

Crossrefs

Subsets of this type are counted by A384177, for runs A384175 (complement A384176).
These are the indices of strict rows in A384877, see A384878, A245563, A245562, A246029.
A000120 counts binary indices.
A098859 counts Wilf partitions (distinct multiplicities), complement A336866.
A356606 counts strict partitions without a neighborless part, complement A356607.
A384890 counts maximal anti-runs in binary indices, runs A069010.

Programs

  • Mathematica
    bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    Select[Range[100],UnsameQ@@Length/@Split[bpe[#],#2!=#1+1&]&]
Showing 1-10 of 33 results. Next