A160054 Primes prime(k) such that prime(k)^2 + prime(k+1)^2 - 1 is a perfect square.
7, 11, 23, 109, 211, 307, 1021, 4583, 42967, 297779, 1022443, 1459811, 10781809, 125211211, 11673806759, 3019843939831, 40047392632801, 88212019638251209, 444190204424015227, 57852556614292865039, 9801250757169593701501, 64747502900142088755541, 619216322498658374863033
Offset: 1
Keywords
Examples
7^2 + 11^2 - 1 = 13^2. 11^2 + 13^2 - 1 = 17^2. 23^2 + 29^2 - 1 = 37^2. 109^2 + 113^2 - 1 = 157^2. 211^2 + 223^2 - 1 = 307^2. 307^2 + 311^2 - 1 = 19^2*23^2. 1021^2 + 1031^2 - 1 = 1451^2. 4583^2 + 4591^2 - 1 = 13^2*499^2.
Programs
-
Magma
[n: n in [0..2*10^7] | IsSquare(n^2+NextPrime(n+1)^2-1) and IsPrime(n)]; // Vincenzo Librandi, Aug 02 2015
-
Mathematica
lst = {}; p = q = 2; While[p < 4000000000, q = NextPrime@ p; If[ IntegerQ[ Sqrt[p^2 + q^2 - 1]], AppendTo[lst, p]; Print@ p]; p = q]; lst (* Robert G. Wilson v, May 31 2009 *)
-
PARI
p=2;forprime(q=3,1e6,if(issquare(q^2+p^2-1),print1(p", "));p=q) \\ Charles R Greathouse IV, Nov 06 2014
-
PARI
is(n)=issquare(n^2+nextprime(n+1)^2-1)&&isprime(n) \\ Charles R Greathouse IV, Nov 29 2014
Extensions
Edited and 4 more terms from R. J. Mathar, May 08 2009
a(13) from Robert G. Wilson v, May 31 2009
a(15)-a(16) from Donovan Johnson, May 17 2010
More terms from Jinyuan Wang, Jan 09 2021
Comments