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

A211395 Number of Sophie Germain primes between 2^n and 2^(n+1).

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 3, 7, 8, 13, 23, 41, 67, 111, 193, 360, 630, 1091, 1938, 3558, 6448, 11876, 21649, 40151, 73658, 135711, 251786, 468678, 875247, 1634069, 3060794, 5746245, 10806204, 20356921, 38433398, 72656139, 137562095, 260848098, 495343258, 941805467, 1792999074
Offset: 0

Views

Author

Brad Clardy, Feb 08 2013

Keywords

Comments

To be precise, the number of Sophie Germain primes p, 2^n < p <= 2^(n+1). Since 2 is a Sophie Germain prime, this precise definition is important only for determining a(0) and a(1). The alternative definition (with 2^n <= p < 2^(n+1)) would give the sequence 0, 2, 1, 1, 2, 2, 3, 7, 8, 13, 23, 41, 67, 111, 193, ...
The Sophie Germain primes p are in A005384. The corresponding primes s = 2p + 1 are called safe primes, and are in A005385. The number of safe primes between 2^(n+1) and 2^(n+2) is given by the sequence in the previous paragraph.

Crossrefs

Programs

  • Mathematica
    nmax = 36; rtable = Table[0, {nmax}];
    Do[r = 0;
      Do[If[And[PrimeQ[i], PrimeQ[2 i + 1]], r++], {i, 1 + 2^n,
        2^(n + 1)}]; Print[n, " ", r];
      rtable[[n + 1]] = r, {n, 0, nmax - 1}];
    rtable (* Paul D. Beale, Sep 19 2014 *)
  • PARI
    a211395(n) = {local(r,i); r=0; for(i=2^n+1, 2^(n+1), if(isprime(i)&&isprime(2*i+1), r=r+1)); r} \\ Michael B. Porter, Feb 08 2013

Formula

a(n) = A211397(n+1) - A211397(n). - Michel Marcus, Sep 22 2014

Extensions

a(29)-a(36) from Paul D. Beale, Sep 19 2014
a(37)-a(40) from Amiram Eldar, Jul 25 2025
Showing 1-1 of 1 results.