OFFSET
1,4
COMMENTS
prime(j) is used here to refer to the j-th prime.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
The first prime pair (x^2-x+11, x^2+x+11) is obtained for x = 0: 0^2-0+11 = 11 and 0^2+0+11 = 11; 11 is the fifth prime, hence a(1) = 5-5 = 0.
The second prime pair is obtained for x = 1: 1^2-1+11 = 11 and 1^2+1+11 = 13; 11 is the fifth prime and 13 is the sixth prime, hence a(2) = 6-5 = 1.
The third prime pair is obtained for x = 2: 2^2-2+11 = 13 and 2^2+2+11 = 17; 13 is the sixth prime and 17 is the seventh prime, hence a(3) = 7-6 = 1.
The eleventh prime pair is obtained for x = 13: 13^2-13+11 = 167 and 13^2+13+11 = 193; 167 is prime(39) and 193 is prime(44), hence a(11) = 44-39 = 5.
MAPLE
for x from 0 to 1000 do mp := x^2+x+11 ; kp := x^2-x+11 ; if isprime(mp) and isprime(kp) then m := numtheory[pi](mp) ; k := numtheory[pi](kp) ; printf("%d, ", m-k) ; end if; end do : # R. J. Mathar, Mar 01 2010
MATHEMATICA
pp[n_]:=Module[{c=n^2+11}, If[AllTrue[c+{n, -n}, PrimeQ], PrimePi[c+n]- PrimePi[ c-n], 0]]; Join[{0}, Array[pp, 1000]/.(0->Nothing)] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Oct 15 2017 *)
PROG
(Magma) PrimePi:=func< n | #PrimesUpTo(n) >; [ PrimePi(p)-PrimePi(q): x in [0..850] | IsPrime(p) and IsPrime(q) where p is x^2+x+11 where q is x^2-x+11 ]; // Klaus Brockhaus, Feb 27 2010
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Feb 23 2010
EXTENSIONS
Edited and extended by Klaus Brockhaus, Feb 27 2010
a(15) corrected and sequence extended by R. J. Mathar, Mar 01 2010
STATUS
approved