OFFSET
1,1
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
a(1) = 5^2 + 7^2 - 1 = 73, which is prime.
MAPLE
K := proc(x) local a; a:=ithprime(x)^2+ithprime(x+1)^2-1; if (isprime(a))then RETURN (a) fi: end: seq(K(x), x=1..500); # K. D. Bajpai, Jul 07 2013
K:=proc()local x, a, c; c:=1; for x from 1 to 5000 do; a:=ithprime(x)^2+ithprime(x+1)^2-1; if isprime(a) then lprint(c, a); c:=c+1; fi; od; end: K(); # K. D. Bajpai, Jul 07 2013
MATHEMATICA
t = {}; Do[p = Prime[n]; q = Prime[n + 1]; p2 = p^2 + q^2 - 1; If[PrimeQ[p2], AppendTo[t, p2]], {n, 200}]; t (* T. D. Noe, Jul 09 2013 *)
PROG
(PARI) is(n)=if(isprime(n), my(x=sqrtint((n+1)\2)); nextprime(x+1)^2 +precprime(x)^2==n+1 && n>3, 0) \\ Charles R Greathouse IV, Jul 08 2013
(PARI) p=2; forprime(q=3, 1e5, if(isprime(t=p^2+q^2-1), print1(t", ")); p=q) \\ Charles R Greathouse IV, Jul 08 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
K. D. Bajpai, Jul 07 2013
STATUS
approved