OFFSET
1,1
EXAMPLE
3 and 5 are consecutive primes, 5^2-3^2 = 25-9 = 16. 17 is prime, hence 3 is in the sequence.
79 and 83 are consecutive primes, 83^2-79^2 = 6889-6241 = 648. 647 is prime, hence 79 is in the sequence.
89 and 97 are consecutive primes, 97^2-89^2 = 9409-7921 = 1488. 1487 (as well as 1489) is prime, hence 89 is in the sequence.
MAPLE
isA128926 := proc(n) local p, q ; p := ithprime(n) ; q := ithprime(n+1) ; isprime((p+q)*(q-p)+1) or isprime((p+q)*(q-p)-1) ; end:
for n from 1 to 100 do if isA128926(n) then printf("%d, ", ithprime(n)) ; fi ; od ; # R. J. Mathar, Apr 26 2007
MATHEMATICA
Prime@ Select[ Range@ 75, PrimeQ[ Prime[ # + 1]^2 - Prime@#^2 - 1] || PrimeQ[ Prime[ # + 1]^2 - Prime@#^2 + 1] &] (* Robert G. Wilson v *)
PROG
(Magma) [ p: p in PrimesUpTo(380) | IsPrime(q^2-p^2-1) or IsPrime(q^2-p^2+1) where q is NextPrime(p) ]; /* Klaus Brockhaus, May 05 2007 */
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot, Apr 25 2007
EXTENSIONS
STATUS
approved