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

A385572 Number of subsets of {1..n} with the same number of maximal runs (increasing by 1) as maximal anti-runs (increasing by more than 1).

Original entry on oeis.org

1, 2, 3, 4, 7, 12, 19, 34, 63, 112, 207, 394, 739, 1398, 2687, 5152, 9891, 19128, 37039, 71754, 139459, 271522, 528999, 1032308, 2017291, 3945186, 7723203, 15134440, 29679407, 58245068, 114389683, 224796210, 442021743, 869658304, 1711914351, 3371515306
Offset: 0

Views

Author

Gus Wiseman, Jul 04 2025

Keywords

Comments

Also the number of subsets of {1..n} with the same number of adjacent elements increasing by 1 as adjacent elements increasing by more than 1.

Examples

			The set {2,3,5,6,8} has maximal runs ((2,3),(5,6),(8)) and maximal anti-runs ((2),(3,5),(6,8)) so is counted under a(8).
The a(0) = 1 through a(6) = 19 subsets:
  {}  {}   {}   {}   {}       {}       {}
      {1}  {1}  {1}  {1}      {1}      {1}
           {2}  {2}  {2}      {2}      {2}
                {3}  {3}      {3}      {3}
                     {4}      {4}      {4}
                     {1,2,4}  {5}      {5}
                     {1,3,4}  {1,2,4}  {6}
                              {1,2,5}  {1,2,4}
                              {1,3,4}  {1,2,5}
                              {1,4,5}  {1,2,6}
                              {2,3,5}  {1,3,4}
                              {2,4,5}  {1,4,5}
                                       {1,5,6}
                                       {2,3,5}
                                       {2,3,6}
                                       {2,4,5}
                                       {2,5,6}
                                       {3,4,6}
                                       {3,5,6}
		

Crossrefs

The LHS is counted by A034839 (for partitions A384881, strict A116674), rank statistic A069010.
The case containing n + 1 is A217615.
The RHS is counted by A384893 or A210034 (for partitions A268193, strict A384905), rank statistic A384890.
Subsets of this type are ranked by A385575.
A384175 counts subsets with all distinct lengths of maximal runs, complement A384176.
A384877 gives lengths of maximal anti-runs in binary indices, firsts A384878.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<5, [1, 2, 3, 4, 7][n+1], ((3*n-4)*a(n-1)-
          (3*n-5)*a(n-2)+(5*n-12)*a(n-3)-2*(4*n-11)*a(n-4)+4*(n-3)*a(n-5))/(n-1))
        end:
    seq(a(n), n=0..35);  # Alois P. Heinz, Jul 06 2025
  • Mathematica
    Table[Length[Select[Subsets[Range[n]],Length[Split[#,#2==#1+1&]]==Length[Split[#,#2!=#1+1&]]&]],{n,0,10}]
  • PARI
    a(n)=polcoef([1,1,1]*[x,0,0;x,x^2,1;0,x,x]^n*[1,0,0]~,n) \\ Christian Sievers, Jul 06 2025

Formula

Let M be the matrix [1,0,0; 1,x,1/x; 0,1,1]. Then a(n) is the sum of the constant terms of the entries in the left column of M^n. - Christian Sievers, Jul 06 2025

Extensions

a(21) and beyond from Christian Sievers, Jul 06 2025

A385215 Number of maximal sparse submultisets of the prime indices of n, where a multiset is sparse iff 1 is not a first difference.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jul 03 2025

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.

Examples

			The sparse submultisets of the prime indices of n = 8 are {{},{1},{1,1},{1,1,1}}, with maximization {{1,1,1}}. So a(8) = 1.
The sparse submultisets of the prime indices of n = 462 are {{},{1},{2},{4},{5},{1,4},{2,4},{1,5},{2,5}}, with maximization {{1,4},{1,5},{2,4},{2,5}}, so a(462) = 4.
The prime indices of n together their a(n) maximal sparse submultisets for n = 1, 6, 210, 462, 30030, 46410:
  {}  {1,2}  {1,2,3,4}  {1,2,4,5}  {1,2,3,4,5,6}  {1,2,3,4,6,7}
  ------------------------------------------------------------
  {}   {1}     {1,3}      {1,4}       {2,5}          {1,3,6}
       {2}     {1,4}      {1,5}       {1,3,5}        {1,3,7}
               {2,4}      {2,4}       {1,3,6}        {1,4,6}
                          {2,5}       {1,4,6}        {1,4,7}
                                      {2,4,6}        {2,4,6}
                                                     {2,4,7}
		

Crossrefs

This is the maximal case of A166469.
For binary instead of prime indices we have A384883, maximal case of A245564.
The greatest number whose prime indices are one of these submultisets is A385216.
A034839 counts subsets by number of maximal runs, for strict partitions A116674.
A384887 counts partitions with equal lengths of gapless runs, distinct A384884.
A384893 counts subsets by number of maximal anti-runs, for partitions A268193, A384905.

Programs

  • Mathematica
    prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    maxq[els_]:=Select[els,Not[Or@@Table[Divisible[oth,#],{oth,DeleteCases[els,#]}]]&];
    Table[Length[maxq[Select[Divisors[n],FreeQ[Differences[prix[#]],1]&]]],{n,30}]

Formula

a(n) <= A166469(n).

A385575 Numbers whose binary indices have the same number of adjacent parts differing by 1 as adjacent parts differing by more than 1.

Original entry on oeis.org

1, 2, 4, 8, 11, 13, 16, 19, 22, 25, 26, 32, 35, 38, 44, 49, 50, 52, 64, 67, 70, 76, 87, 88, 91, 93, 97, 98, 100, 104, 107, 109, 117, 128, 131, 134, 140, 151, 152, 155, 157, 167, 174, 176, 179, 182, 185, 186, 193, 194, 196, 200, 203, 205, 208, 211, 214, 217
Offset: 1

Views

Author

Gus Wiseman, Jul 04 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 terms together with their binary expansions and binary indices begin:
    1:       1 ~ {1}
    2:      10 ~ {2}
    4:     100 ~ {3}
    8:    1000 ~ {4}
   11:    1011 ~ {1,2,4}
   13:    1101 ~ {1,3,4}
   16:   10000 ~ {5}
   19:   10011 ~ {1,2,5}
   22:   10110 ~ {2,3,5}
   25:   11001 ~ {1,4,5}
   26:   11010 ~ {2,4,5}
   32:  100000 ~ {6}
   35:  100011 ~ {1,2,6}
   38:  100110 ~ {2,3,6}
   44:  101100 ~ {3,4,6}
   49:  110001 ~ {1,5,6}
   50:  110010 ~ {2,5,6}
   52:  110100 ~ {3,5,6}
   64: 1000000 ~ {7}
   67: 1000011 ~ {1,2,7}
   70: 1000110 ~ {2,3,7}
   76: 1001100 ~ {3,4,7}
   87: 1010111 ~ {1,2,3,5,7}
   88: 1011000 ~ {4,5,7}
   91: 1011011 ~ {1,2,4,5,7}
   93: 1011101 ~ {1,3,4,5,7}
   97: 1100001 ~ {1,6,7}
   98: 1100010 ~ {2,6,7}
  100: 1100100 ~ {3,6,7}
		

Crossrefs

The LHS rank statistic is A069010, counted by A034839 (for partitions A384881, A116674).
The RHS rank statistic is A384890, counted by A384893 (for partitions A268193, A384905).
Subsets of this type are counted by A385572, with n A217615.
A384175 counts subsets with all distinct lengths of maximal runs, complement A384176.
A384877 gives lengths of maximal anti-runs in binary indices, firsts A384878.

Programs

  • Mathematica
    bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    Select[Range[100],Length[Split[bpe[#],#2==#1+1&]]==Length[Split[bpe[#],#2!=#1+1&]]&]
  • PARI
    is_ok(n)=hammingweight(n)==2*hammingweight(bitand(n,n>>1))+1 \\ Christian Sievers, Jul 18 2025

A385891 The number k = a(n) whose Stolarsky representation (row k of A385888) is the binary expansion of n (row n of A030302). Inverse Stolarsky representation of binary expansion of n.

Original entry on oeis.org

1, 2, 4, 3, 9, 6, 7, 5, 22, 15, 14, 10, 17, 11, 12, 8, 56, 36, 38, 24, 35, 23, 25, 16, 43, 28, 27, 18, 30, 19, 20, 13, 145, 91, 93, 58, 98, 61, 62, 39, 90, 57, 59, 37, 64, 40, 41, 26, 111, 70, 72, 45, 69, 44, 46, 29, 77, 49, 48, 31, 51, 32, 33, 21, 378, 235, 237
Offset: 0

Views

Author

Gus Wiseman, Jul 24 2025

Keywords

Comments

A permutation of the positive integers.

Crossrefs

A000120 counts 1's in binary expansion, zeros A023416.
A030302 gives binary expansion.
A035506 is the Stolarsky array.
A385888 is the Stolarsky representation, lengths A200648, sums A200649, zeros A200650, ranks A200714.

Programs

  • Mathematica
    nn=30;
    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}]]];
    ss=Table[stol[n],{n,nn}];
    mnrm[s_]:=If[Min@@s==1,mnrm[DeleteCases[s-1,0]]+1,0];
    Table[Position[ss,If[n==0,{},IntegerDigits[n,2]]][[1,1]],{n,0,mnrm[FromDigits[#,2]&/@ss+1]-1}]

Formula

A385888(a(n)) = A030302(n).

A385892 In the sequence of run lengths of binary indices of each positive integer (A245563), remove all duplicate rows after the first and take the last term of each remaining row.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jul 18 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 53 are {1,3,5,6}, with maximal runs ((1),(3),(5,6)), with lengths (1,1,2), which is the 16th row of A385817, so a(16) = 2.
		

Crossrefs

In the following references, "before" is short for "before removing duplicate rows".
Positions of firsts appearances appear to be A000071.
Without the removals we have A090996.
For sum instead of last we have A200648, before A000120.
For length instead of last we have A200650+1, before A069010 = A037800+1.
Last term of row n of A385817 (ranks A385818, before A385889), first A083368.
A245563 gives run lengths of binary indices, see A245562, A246029, A328592.
A384877 gives anti-run lengths of binary indices, A385816.

Programs

  • Mathematica
    Last/@DeleteDuplicates[Table[Length/@Split[Join@@Position[Reverse[IntegerDigits[n,2]],1],#2==#1+1&],{n,100}]]

A385890 Positions of first appearances in A245563 = run lengths of binary indices.

Original entry on oeis.org

1, 2, 4, 6, 8, 12, 14, 16, 22, 24, 28, 30, 32, 44, 46, 48, 54, 56, 60, 62, 64, 86, 88, 92, 94, 96, 108, 110, 112, 118, 120, 124, 126, 128, 172, 174, 176, 182, 184, 188, 190, 192, 214, 216, 220, 222, 224, 236, 238, 240, 246, 248, 252, 254, 256, 342, 344, 348
Offset: 1

Views

Author

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

Crossrefs

These are positions of firsts appearances in A245563, ranks A385889, reverse A245562.
A384175 counts subsets with all distinct lengths of maximal runs, complement A384176.
A384877 lists anti-run lengths of binary indices, ranks A385816.

Programs

  • Mathematica
    bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    q=Table[Length/@Split[bpe[n],#2==#1+1&],{n,0,1000}];
    Select[Range[Length[q]-1],!MemberQ[Take[q,#-1],q[[#]]]&]
Previous Showing 21-26 of 26 results.