A049040 Number of Sophie Germain primes <= prime(10^n).
1, 6, 26, 167, 1222, 9668, 82237, 711154, 6284076, 56325540, 510628554, 4672267109
Offset: 0
Examples
The first 10 primes are 2,3,5,7,11,13,17,23,29 and 31. 6 of these are Sophie Germain primes, namely: 2,3,5,11,23 and 29.
Programs
-
Mathematica
cnt = 0; currentPrime = 1; For[ i = 1, i == i, i ++, currentPrime = NextPrime[ currentPrime ]; If[ PrimeQ[ 2*currentPrime + 1 ], cnt++ ]; If[ IntegerQ[ Log[ 10, i ] ], Print[ cnt ] ]; ]
-
PARI
list(len) = {my(c = 0, k = 0, pow = 1, pmax = prime(pow)); forprime(p = 1, , if(isprime(2*p+1), c++); if(p == pmax, print1(c, ", "); k++; if(k == len, break); pow *= 10; pmax = prime(pow)));} \\ Amiram Eldar, Jul 25 2025
Extensions
More terms from Alexander D. Healy, Mar 19 2001
Offset changed to 0, a(0) prepended and a(9)-a(11) added by Amiram Eldar, Jul 25 2025
Comments