OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..2500
EXAMPLE
a(1)=31 because (37^2 - 31^2)/2 - 1 = 203 and (37^2 - 31^2)/2 + 1 = 205 (203, 205 are not primes),
a(2)=47 because (53^2 - 47^2)/2 - 1 = 299 and (53^2 - 47^2)/2 + 1 = 301 (299, 301 are not primes),
a(3)=59 because (61^2 - 59^2)/2 - 1 = 119 and (61^2 - 59^2)/2 + 1 = 121 (119, 121 are not primes), ...
MAPLE
ts_p3_21:=proc(n) local a, b, i, ans; ans := [ ]: for i from 2 to n do a := (ithprime(i+1)^(2)-ithprime(i)^(2))/2-1: b := (ithprime(i+1)^(2)-ithprime(i)^(2))/2+1: if not (isprime(a)=true or isprime(b)=true) then ans := [ op(ans), ithprime(i) ]: fi od; RETURN(ans) end: ts_p3_21(500);
MATHEMATICA
Transpose[Select[Partition[Prime[Range[2, 250]], 2, 1], PrimeQ[(#[[2]]^2- #[[1]]^2)/2+{1, -1}]=={False, False}&]][[1]] (* Harvey P. Dale, Jun 19 2014 *)
Select[Partition[Prime[Range[2, 150]], 2, 1], NoneTrue[(#[[2]]^2- #[[1]]^2)/ 2+{1, -1}, PrimeQ]&][[All, 1]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 10 2021 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Jani Melik, Aug 01 2007
STATUS
approved