OFFSET
1,5
EXAMPLE
a(1) = 7 - 7 = 0 where 0^2 + 0 + 17 = 17 = prime(7) and 0^2 - 0 + 17 = 17 = prime(7);
a(2) = 8 - 7 = 1 where 1^2 + 1 + 17 = 19 = prime(8) and 1^2 - 1 + 17 = 17 = prime(7);
a(3) = 9 - 8 = 1 where 2^2 + 2 + 17 = 23 = prime(9) and 2^2 - 2 + 17 = 19 = prime(8);
a(4) = 10 - 9 = 1 where 3^2 + 3 + 17 = 29 = prime(10) and 3^2 - 3 + 17 = 23 = prime(9).
MAPLE
for x from 0 to 1000 do mp := x^2+x+17 ; kp := x^2-x+17 ; 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
f[n_]:=Module[{c=n^2+17, a, b}, a=c+n; b=c-n; If[And@@PrimeQ[{a, b}], PrimePi[a]- PrimePi[b], 0]]; Join[{0}, Select[Array[f, 400, 0], #!=0&]] (* Harvey P. Dale, Jul 13 2011 *)
CROSSREFS
KEYWORD
nonn,less
AUTHOR
Juri-Stepan Gerasimov, Feb 23 2010
EXTENSIONS
a(31) and a(33) corrected and sequence extended by R. J. Mathar, Mar 01 2010
Name edited by Jon E. Schoenfield, Jan 30 2019
STATUS
approved