%I #10 Feb 11 2015 07:49:44
%S 73,457,1801,3049,3529,4057,8209,10369,19609,20809,33289,41521,51217,
%T 84121,103969,111409,115201,121081,129049,141529,150169,155689,180097,
%U 223129,282769,308929,342841,397849,426889,432457,627217,649801,658969,710449,729649
%N Primes of the form p^2 + q^2 - 1 where p and q are consecutive primes.
%H Charles R Greathouse IV, <a href="/A227340/b227340.txt">Table of n, a(n) for n = 1..10000</a>
%e a(1) = 5^2 + 7^2 - 1 = 73, which is prime.
%p 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
%p 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
%t 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 *)
%o (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
%o (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
%Y Cf. A072669.
%K nonn
%O 1,1
%A _K. D. Bajpai_, Jul 07 2013
|