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

A082554 Primes whose base-2 representation is a block of 1's, followed by a block of 0's, followed by a block of 1's.

Original entry on oeis.org

5, 11, 13, 17, 19, 23, 29, 47, 59, 61, 67, 71, 79, 97, 103, 113, 131, 191, 193, 199, 223, 227, 239, 241, 251, 257, 263, 271, 383, 449, 463, 479, 487, 499, 503, 509, 769, 911, 967, 991, 1009, 1019, 1021, 1031, 1039, 1087, 1151, 1279, 1543, 1567, 1663, 1823
Offset: 1

Views

Author

Randy L. Ekl, May 03 2003

Keywords

Comments

The n-th prime is a term iff A100714(n) = 3. - Joseph Biberstine (jrbibers(AT)indiana.edu), Dec 11 2004
A019434 \{3} is a subsequence, since the base-2 representation of a Fermat prime 2^(2^k)+1 > 3 is a single 1, followed by a block of 2^k-1 0's, followed by a last single 1. - Bernard Schott, Mar 07 2023

Examples

			1987 = 11111000011_2, which is a block of 5 1's, followed by a block of 4 0's, followed by a block of 2 1's, so 1987 is a term.
a(3)=17 is a term because it is the 3rd prime whose binary representation splits into exactly three runs: 17_10 = 10001_2 splits into {{1}, {0,0,0}, {1}}.
		

Crossrefs

Cf. A100714, A000040. Primes in A043570.
Cf. A019434.

Programs

  • Mathematica
    Select[Table[Prime[k], {k, 1, 500}], Length[Split[IntegerDigits[ #, 2]]] == 3 &]
  • PARI
    decomp(s)=if(s%2==0,return(1),); k=1; while(k==1,k=s%2; s=floor(s/2)); if(s==0,return(1),); while(k==0,k=s%2; s=floor(s/2)); while(k==1,k=s%2; s=floor(s/2)); return(s)
    forprime(i=1,2000,if(decomp(i)==0,print1(i,", ")))
    
  • Python
    from sympy import isprime
    from itertools import count, islice
    def agen(): yield from filter(isprime, ((1<Michael S. Branicky, Feb 25 2023

A100723 Prime numbers whose binary representations are split into exactly seven runs.

Original entry on oeis.org

149, 173, 181, 277, 293, 331, 337, 347, 349, 373, 421, 557, 587, 593, 599, 601, 613, 617, 619, 653, 659, 673, 691, 701, 709, 727, 733, 757, 809, 811, 821, 857, 859, 877, 937, 941, 1061, 1069, 1093, 1097, 1117, 1129, 1163, 1171, 1181, 1187, 1201, 1213
Offset: 1

Views

Author

Joseph Biberstine (jrbibers(AT)indiana.edu), Dec 11 2004

Keywords

Comments

The n-th prime is a member iff A100714(n)=7

Examples

			a(3) = 181 is a member because it is the 3rd prime whose binary representation splits into exactly 7 runs: 181_10 = 10110101_2.
		

Crossrefs

Programs

  • Maple
    qprime:= proc(n) if isprime(n) then n fi end proc:
    [seq(seq(seq(seq(seq(seq(seq(qprime(2^i1 - 2^i2 + 2^i3 - 2^i4 + 2^i5
    - 2^i6 + 2^i7-1), i7 = 1..i6-1),i6=i5-1..2,-1),i5=3..i4-1),  i4=i3-1..4,-1),i3=5..i2-1),i2=i1-1..6,-1),i1=7..12)]; # Robert Israel, Nov 24 2020
  • Mathematica
    Select[Table[Prime[k], {k, 1, 50000}], Length[Split[IntegerDigits[ #, 2]]] == 7 &]

A100722 Prime numbers whose binary representations are split into exactly five runs.

Original entry on oeis.org

37, 41, 43, 53, 73, 83, 89, 101, 107, 109, 137, 139, 151, 157, 163, 167, 179, 197, 211, 229, 233, 269, 281, 283, 307, 311, 313, 317, 353, 359, 367, 379, 389, 397, 401, 409, 419, 431, 433, 439, 443, 457, 461, 467, 491, 521, 523, 541, 547, 563, 569, 571, 577
Offset: 1

Views

Author

Joseph Biberstine (jrbibers(AT)indiana.edu), Dec 11 2004

Keywords

Comments

The n-th prime is a term iff A100714(n)=5.

Examples

			a(3)=43 is a term because it is the 3rd prime whose binary representation splits into exactly five runs. 43_10 = 101011_2 splits into {{1}, {0}, {1}, {0}, {1,1}}.
		

Crossrefs

Cf. A100714, A000668 (exactly 1 run), A082554 (exactly 3 runs), A100723 (exactly 7 runs).

Programs

  • Mathematica
    Select[Table[Prime[k], {k, 1, 50000}], Length[Split[IntegerDigits[ #, 2]]] == 5 &]

A100724 Prime numbers whose binary representations are split into at most 3 runs.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 47, 59, 61, 67, 71, 79, 97, 103, 113, 127, 131, 191, 193, 199, 223, 227, 239, 241, 251, 257, 263, 271, 383, 449, 463, 479, 487, 499, 503, 509, 769, 911, 967, 991, 1009, 1019, 1021, 1031, 1039, 1087, 1151, 1279, 1543, 1567
Offset: 1

Views

Author

Joseph Biberstine (jrbibers(AT)indiana.edu), Dec 11 2004

Keywords

Comments

The n-th prime is a term iff A100714(n) <= 3.

Examples

			a(3)=5 is a term because it is the 3rd prime whose binary representation splits into no more than 3 runs: 5_10 = 101_2.
		

Crossrefs

Includes A000668 and A095078.

Programs

  • Maple
    R:= 2,3: count:= 2:
    for d from 2 while count < 100 do
      for a from d-1 to 1 by -1 do
        for b from 0 to a-1 do
          p:= 2*(2^d - 2^a + 2^b)-1;
          if isprime(p) then R:= R,p; count:= count+1 fi
      od od;
      p:= 2^(d+1)-1;
      if isprime(p) then R:= R,p; count:= count+1 fi
    od:
    R; # Robert Israel, Oct 30 2024
  • Mathematica
    Select[Table[Prime[k], {k, 1, 50000}], Length[Split[IntegerDigits[ #, 2]]] <= 3 &]

A100725 Prime numbers whose binary representations are split into a maximum of 5 runs.

Original entry on oeis.org

2, 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, 151, 157, 163, 167, 179, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 281, 283, 307, 311
Offset: 1

Views

Author

Joseph Biberstine (jrbibers(AT)indiana.edu), Dec 11 2004

Keywords

Comments

The m-th prime is a term iff A100714(m) <= 5.

Examples

			a(3)=5 is a term because it is the 3rd prime whose binary representation splits into at most 5 runs: 5_10 = 101_2.
		

Crossrefs

Cf. A100714, A100722 (exactly 5 runs).

Programs

  • Mathematica
    Select[Table[Prime[k], {k, 1, 50000}], Length[Split[IntegerDigits[ #, 2]]] <= 5 &]

A100726 Prime numbers whose binary representations are split into a maximum of 7 runs.

Original entry on oeis.org

2, 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
Offset: 1

Views

Author

Joseph Biberstine (jrbibers(AT)indiana.edu), Dec 11 2004

Keywords

Comments

The m-th prime is a term iff A100714(m) <= 7.
Missing primes begin 661, 677, 683, 853, 1109, 1193, 1237, 1301, 1321, 1361, 1367, 1373, .... - Charles R Greathouse IV, Oct 19 2015

Examples

			a(3)=5 is a term because it is the 3rd prime whose binary representation splits into at most 7 runs: 5_10 = 101_2.
		

Crossrefs

Cf. A100714, A100725 (maximum of 5 runs), A100724 (maximum of 3 runs), A100723 (exactly 7 runs).

Programs

  • Mathematica
    Select[Table[Prime[k], {k, 1, 50000}], Length[Split[IntegerDigits[ #, 2]]] <= 7 &]
  • PARI
    is(n)=hammingweight(bitxor(n, n>>1))<8 && isprime(n) \\ Charles R Greathouse IV, Oct 19 2015
Showing 1-6 of 6 results.