A284950 Number of primes p <= n such that 2*n-p and 2*n+p are prime.
0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 2, 1, 0, 3, 0, 1, 3, 0, 1, 3, 1, 0, 3, 1, 0, 3, 1, 0, 5, 0, 1, 4, 0, 1, 3, 0, 1, 4, 0, 0, 4, 1, 0, 6, 0, 0, 4, 0, 1, 2, 1, 1, 4, 1, 0, 4, 0, 0, 9, 0, 0, 5, 0, 0, 5, 1, 0, 4, 0, 0, 5, 0, 0, 6, 0, 1, 5, 0, 1, 5, 0, 0, 7, 1, 0, 5, 1, 0, 7, 0, 0, 6, 0, 0, 4, 1, 1, 4, 0
Offset: 1
Examples
a(5) is 1, because of all the pairs of primes p1 <= p2 which sum to 5*2=10, namely {3,7} and {5,5}, only (3,7) has p1+10 prime.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
f:= proc(n) local p1,p2,t; t:= 0: p1:= 2: do p1:= nextprime(p1); if p1 > n then return t fi; if isprime(p1+2*n) and isprime(2*n-p1) then t:= t+1 fi od end proc: map(f, [$1..1000]); # Robert Israel, Jul 20 2020
-
Mathematica
For[i = 1, i < 1001, i++, ee = 2*i; a = 0; For[j = 3, j < ee/2, j += 2, If[PrimeQ[j] == True && PrimeQ[ee - j] == True, If[PrimeQ[ee + j] == True, a += 1, a = a]]]; Print[ee, " ", a]]
Extensions
Definition corrected by Robert Israel, Jul 20 2020
Comments