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

A164711 Those positive integers missing from sequence A164710. Those positive integers that, when written in binary, contain at least two runs of 0's that are of differing lengths.

Original entry on oeis.org

18, 20, 34, 37, 38, 40, 41, 44, 50, 52, 66, 68, 69, 70, 72, 74, 75, 77, 78, 80, 81, 82, 83, 84, 88, 89, 92, 98, 101, 102, 104, 105, 108, 114, 116, 130, 132, 133, 134, 137, 138, 139, 140, 141, 142, 144, 145, 146, 148, 149, 150, 151, 152, 154, 155, 157, 158, 160, 161
Offset: 1

Views

Author

Leroy Quet, Aug 23 2009

Keywords

Comments

Clarification: A binary number consists of "runs" completely of 1's alternating with runs completely of 0's. No two or more runs all of the same digit are adjacent.

Crossrefs

Cf. A164710.

Extensions

Extended by Ray Chandler, Mar 14 2010

A164707 A positive integer n is included if all runs of 1's in binary n are of the same length.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 21, 24, 27, 28, 30, 31, 32, 33, 34, 36, 37, 40, 41, 42, 48, 51, 54, 56, 60, 62, 63, 64, 65, 66, 68, 69, 72, 73, 74, 80, 81, 82, 84, 85, 96, 99, 102, 108, 112, 119, 120, 124, 126, 127, 128, 129, 130, 132, 133, 136
Offset: 1

Views

Author

Leroy Quet, Aug 23 2009

Keywords

Comments

Clarification: A binary number consists of "runs" completely of 1's alternating with runs completely of 0's. No two or more runs all of the same digit are adjacent.
This sequence contains in part positive integers that each contain one run of 1's. For those members of this sequence each with at least two runs of 1's, see A164709.

Examples

			From _Gus Wiseman_, Oct 31 2019: (Start)
The sequence of terms together with their binary expansions and binary indices begins:
   1:      1 ~ {1}
   2:     10 ~ {2}
   3:     11 ~ {1,2}
   4:    100 ~ {3}
   5:    101 ~ {1,3}
   6:    110 ~ {2,3}
   7:    111 ~ {1,2,3}
   8:   1000 ~ {4}
   9:   1001 ~ {1,4}
  10:   1010 ~ {2,4}
  12:   1100 ~ {3,4}
  14:   1110 ~ {2,3,4}
  15:   1111 ~ {1,2,3,4}
  16:  10000 ~ {5}
  17:  10001 ~ {1,5}
  18:  10010 ~ {2,5}
  20:  10100 ~ {3,5}
  21:  10101 ~ {1,3,5}
  24:  11000 ~ {4,5}
  27:  11011 ~ {1,2,4,5}
(End)
		

Crossrefs

The version for prime indices is A072774.
The binary expansion of n has A069010(n) runs of 1's.
Numbers whose runs are all of different lengths are A328592.
Partitions with equal multiplicities are A047966.
Numbers whose binary expansion is aperiodic are A328594.
Numbers whose reversed binary expansion is a necklace are A328595.
Numbers whose reversed binary expansion is a Lyndon word are A328596.

Programs

  • Maple
    isA164707 := proc(n) local bdg,arl,lset ; bdg := convert(n,base,2) ; lset := {} ; arl := -1 ; for p from 1 to nops(bdg) do if op(p,bdg) = 1 then if p = 1 then arl := 1 ; else arl := arl+1 ; end if; else if arl > 0 then lset := lset union {arl} ; end if; arl := 0 ; end if; end do ; if arl > 0 then lset := lset union {arl} ; end if; return (nops(lset) <= 1 ); end proc: for n from 1 to 300 do if isA164707(n) then printf("%d,",n) ; end if; end do; # R. J. Mathar, Feb 27 2010
  • Mathematica
    Select[Range@ 140, SameQ @@ Map[Length, Select[Split@ IntegerDigits[#, 2], First@ # == 1 &]] &] (* Michael De Vlieger, Aug 20 2017 *)
  • Perl
    foreach(1..140){
        %runs=();
        $runs{$}++ foreach split /0+/, sprintf("%b",$);
        print "$_, " if 1==keys(%runs);
    }
    # Ivan Neretin, Nov 09 2015

Extensions

Extended beyond 42 by R. J. Mathar, Feb 27 2010

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 *)

A164712 A positive integer n is included if all runs of 0's in binary n are of the same length, and if there are at least two runs of 0's.

Original entry on oeis.org

10, 21, 22, 26, 36, 42, 43, 45, 46, 53, 54, 58, 73, 76, 85, 86, 87, 90, 91, 93, 94, 100, 106, 107, 109, 110, 117, 118, 122, 136, 147, 153, 156, 170, 171, 173, 174, 175, 181, 182, 183, 186, 187, 189, 190, 201, 204, 213, 214, 215, 218, 219, 221, 222, 228, 234, 235
Offset: 1

Views

Author

Leroy Quet, Aug 23 2009

Keywords

Comments

Clarification: A binary number consists of "runs" completely of 1's alternating with runs completely of 0's. No two or more runs all of the same digit are adjacent.

Examples

			100 is a term since its binary expansion "1100100" has two groups of zeros that are of the same length. - _Michael De Vlieger_, Nov 04 2017
		

Crossrefs

Cf. A164710.

Programs

  • Mathematica
    brQ[n_]:=Module[{rz=Select[Split[IntegerDigits[n,2]],MemberQ[#,0]&]}, Length[ rz]>1 && Length[Union[Length/@rz]]==1]; Select[Range[250],brQ] (* Harvey P. Dale, Mar 23 2015 *)
    Select[Range[2^8], And[Length@ # > 1, Length@ Union@ # == 1] &@ Map[Length, Select[Split@ IntegerDigits[#, 2], First@ # == 0 &]] &] (* Michael De Vlieger, Nov 04 2017 *)

Extensions

More terms from Sean A. Irvine, Sep 28 2009

A322463 Reverse runs of zeros in binary expansion of n and convert back to decimal.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 20, 19, 18, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 40, 35, 36, 41, 44, 39, 34, 37, 42, 43, 38, 45, 46, 47, 48, 49, 52, 51, 50, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 80, 67
Offset: 0

Views

Author

Rémy Sigrist, Dec 09 2018

Keywords

Comments

This sequence is a self-inverse permutation of nonnegative integers.

Examples

			For n = 150:
- the binary representation of 150 is "10010110",
- we have three runs of zeros: "00", "0" and "0",
- we exchange the first and the third run, and the second remains in place,
- we obtain: "10101100",
- hence a(150) = 172.
		

Crossrefs

See A322464 for the variant where we reverse the runs of ones.
See A056539 for a similar sequence.

Programs

  • Mathematica
    a[n_] := Module[{s=Split[IntegerDigits[n,2]]}, m=Length[s]; m2=m-Mod[m,2]; If[m2>0, ind=Riffle[Range[1,m,2],Range[m2,1,-2]]; FromDigits[Flatten[s[[ind]]],2],n]]; Array[a, 100, 0] (* Amiram Eldar, Dec 12 2018 *)
  • PARI
    a(n) = {
        my (r=n, z=[], v=0, p=1, i=0);
        while (r, my (l=valuation(r+(r%2),2)); if (r%2==0, z=concat(l,z)); r\=2^l);
        while (n, my (l=valuation(n+(n%2),2)); if (n%2, v+=(2^l-1)*p; p*=2^l, p*=2^z[i++]); n\=2^l);
        return (v);
    }

Formula

A000120(a(n)) = A000120(n).
A005811(a(n)) = A005811(n).
a(A164710(n)) = A164710(n).
a(A322464(n)) = A322464(a(n)).
a(2^n) = 2^n.
a(2^n-1) = 2^n-1.

A164713 A positive integer n is included if all runs of 0's in binary n are of the same length, and if all runs of 1's in binary n are of the same length.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 17, 21, 24, 27, 28, 30, 31, 32, 33, 36, 42, 48, 51, 54, 56, 60, 62, 63, 64, 65, 73, 85, 96, 99, 112, 119, 120, 124, 126, 127, 128, 129, 136, 170, 192, 195, 204, 219, 224, 231, 238, 240, 248, 252, 254, 255, 256, 257, 273
Offset: 1

Views

Author

Leroy Quet, Aug 23 2009

Keywords

Comments

Clarification: A binary number consists of "runs" completely of 1's alternating with runs completely of 0's. No two or more runs all of the same digit are adjacent.
The length of each run of 1's may be different that the length of each run of 0's.
This sequence contains those positive integers in both sequence A164707 and sequence A164710.
For those integers in this sequence that each have at least two runs of 0's and at least two runs of 1's, see sequence A164714.

Crossrefs

Extensions

More terms from Sean A. Irvine, Sep 28 2009

A385214 Number of subsets of {1..n} without all equal lengths of maximal runs of consecutive elements increasing by 1.

Original entry on oeis.org

0, 0, 0, 0, 2, 8, 25, 66, 159, 361, 791, 1688, 3539, 7328, 15040, 30669, 62246, 125896, 253975, 511357, 1028052
Offset: 0

Views

Author

Gus Wiseman, Jun 25 2025

Keywords

Examples

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

Crossrefs

These subsets are ranked by A164708, complement A164707
The complement is counted by A243815.
For distinct instead of equal lengths we have A384176, complement A384175.
For anti-runs instead of runs we have complement of A384889, for partitions A384888.
For permutations instead of subsets we have complement of A384892, distinct A384891.
For partitions instead of subsets we have complement of A384904, strict A384886.
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.
A384177 counts subsets with all distinct lengths of maximal anti-runs, ranks A384879.
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
    Table[Length[Select[Subsets[Range[n]],!SameQ@@Length/@Split[#,#2==#1+1&]&]],{n,0,10}]
Showing 1-7 of 7 results.