OFFSET
1,1
COMMENTS
The value (prime(n+1)^2-prime(n)^2)/2 must be an integer.
EXAMPLE
a(1)=3 because (5^2 - 3^2)/2 - 1 = 7 and (5^2 - 3^2)/2 + 1 = 9 (9 is not prime),
a(2)=7 because (11^2 - 7^2)/2 - 1 = 35 and (11^2 - 7^2)/2 + 1 = 37 (35 is not prime),
a(3)=11 because (13^2 - 11^2)/2 - 1 = 23 and (13^2 - 11^2)/2 + 1 = 25 (25 is not prime), ...
MAPLE
ts_p3_20:=proc(n) local a, b, i, ans; ans := [ ]: for i from 2 by 1 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 and isprime(b)=true) then ans := [ op(ans), ithprime(i) ]: fi od; RETURN(ans) end: ts_p3_20(300);
MATHEMATICA
npQ[n_]:=Module[{x=(Last[n]^2-First[n]^2)/2}, IntegerQ[x]&&MemberQ[ PrimeQ[ {x+1, x-1}], False]]; Transpose[Select[Partition[Prime[ Range[80]], 2, 1], npQ]][[1]] (* Harvey P. Dale, May 07 2011 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Jani Melik, Aug 01 2007
STATUS
approved