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

A095058 Number of primes with a single 0-bit (A095078) in range ]2^n,2^(n+1)].

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jun 01 2004

Keywords

Comments

For large n, the average value of a(n) is about 4. See A138290 for the n such that a(n)=0. - T. D. Noe, Mar 14 2008

Crossrefs

Cf. A095018.

Programs

  • PARI
    a(n) = sum(k=2^n+1, 2^(n+1), isprime(k) && (#select(x->x==0, binary(k))==1)); \\ Michel Marcus, Sep 11 2015

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 &]

A117890 Numbers k such that number of non-leading 0's in binary representation of k divides k.

Original entry on oeis.org

2, 4, 5, 6, 10, 11, 12, 13, 14, 16, 18, 22, 23, 24, 26, 27, 28, 29, 30, 36, 40, 42, 46, 47, 48, 54, 55, 58, 59, 60, 61, 62, 65, 75, 76, 78, 80, 84, 88, 90, 94, 95, 99, 100, 102, 104, 105, 108, 110, 111, 112, 114, 118, 119, 120, 122, 123, 124, 125, 126, 132, 140, 144, 145
Offset: 1

Views

Author

Leroy Quet, Mar 30 2006

Keywords

Comments

Contains primes of A095078(n) as a subset. Intersection of a(n) with A049445(n) is A117891(n). - R. J. Mathar, Apr 03 2006

Examples

			24 is 11000 in binary. This binary representation has three 0's and 3 divides 24. So 24 is in the sequence.
		

Crossrefs

Programs

  • C
    #include 
    int main(int argc, char *argv[]) { for(int n=1; n< 500; n++) { int digs=0; int nshifted=n; while(nshifted) { digs += 1- nshifted & 1; nshifted >>= 1; } if ( digs) if( n % digs == 0 ) printf("%d, ",n); } } // R. J. Mathar, Apr 03 2006
    
  • Haskell
    a117890 n = a117890_list !! (n-1)
    a117890_list = [x | x <- [1..], let z = a023416 x, z > 0, mod x z == 0]
    -- Reinhard Zumkeller, Mar 31 2015

Formula

a(n) <= A117891(n). - R. J. Mathar, Apr 03 2006
a(n) mod A023416(a(n)) = 0. - Reinhard Zumkeller, Nov 22 2007

Extensions

More terms from R. J. Mathar, Apr 03 2006

A272143 For a given n, and any m less than n-1, the total number of primes of the form 2^n-2^m-1.

Original entry on oeis.org

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

Views

Author

Hans Havermann, Apr 21 2016

Keywords

Comments

For the first 12000 terms the average is ~3.8 with a maximum of 25 at a(11520).
Essentially the same as A095058. - R. J. Mathar, Apr 24 2016

Examples

			For n=1, m<0, so there are no solutions. For n=2 there is one solution: m=0, yielding prime 2. For n=3, one solution: m=1, yielding prime 5. For n=4 there are two solutions: m=2 and m=1, yielding primes 11 and 13 respectively. The primes so formed are terms of A095078.
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Table[2^n - 2^m - 1, {m, 0, n - 2}], PrimeQ[#] & ]], {n, 1, 100}] (* Robert Price, Apr 21 2016 *)
  • Python
    from sympy import isprime
    def a(n): return sum(1 for i in range(n-1) if isprime(2**n-1-2**i))
    print([a(n) for n in range(1, 81)]) # Michael S. Branicky, Nov 09 2023

A368214 Primes with a single 0-bit in binary expansion such that changing the position of the 0-bit always gives a nonprime (including the one with a leading zero).

Original entry on oeis.org

2, 2039, 6143, 522239, 33546239, 260046847, 16911433727, 32212254719, 2196875771903, 140735340871679, 2251799813685119, 9005000231485439, 576460752169205759, 36893488147410714623, 147573811852188057599, 9444732965739282038783, 154742504910672534362390399
Offset: 1

Views

Author

Ya-Ping Lu, Dec 23 2023

Keywords

Comments

It seems that most of the terms end with '9', followed by those ending with '3', '7', and '1'.

Examples

			2 is a term because 2 is a prime with one '0' in binary form ('10') and '01' is not a prime. 2039 is a term because 2039 is a prime with one '0' in binary form ('11111110111') and changing the position of the '0', for example, '11111111011' = 2043 and '01111111111' = 1023, always results in a composite.
		

Crossrefs

Subsequence of A095078.

Programs

  • Python
    from sympy import isprime
    for n in range(1,100):
        s = n*'1'; c = 0
        for j in range(n+1):
            num = int(s[:j]+'0'+s[j:], 2)
            if isprime(num):
                c += 1
                if c == 1: r = num
                if c == 2: break
        if c == 1: print(r, end = ', ')
Showing 1-5 of 5 results.