OFFSET
1,1
LINKS
Zak Seidov, Table of n, a(n) for n = 1..22054 (all terms up to 10^6).
FORMULA
a(n) = sqrt(A062703(n)). - Zak Seidov, May 26 2013
EXAMPLE
6^2 = 17 + 19, 1610^2 = 1296041 + 1296059.
MATHEMATICA
Select[Sqrt[#]&/@(Total/@Partition[Prime[Range[50000]], 2, 1]), IntegerQ] (* Harvey P. Dale, Oct 04 2014 *)
PROG
(PARI) is(n)=if(n%2, return(0)); nextprime(n^2/2+1)+precprime(n^2/2)==n^2 \\ Charles R Greathouse IV, Apr 29 2015
(PARI) select( {is_A074924(n)=!bittest(n=n^2, 0) && precprime(n\2)+nextprime(n\/2)==n}, [1..999]) \\ M. F. Hasler, Jan 03 2020
(PARI) A74924=[6]; apply( A074924(n)={while(n>#A74924, my(N=A74924[#A74924]); until( is_A074924(N+=2), ); A74924=concat(A74924, N)); A74924[n]}, [1..99]) \\ M. F. Hasler, Jan 03 2020
(Python)
from itertools import count, islice
from sympy import nextprime, prevprime
def agen(): # generator of terms
for k in count(4, step=2):
kk = k*k
if prevprime(kk//2+1) + nextprime(kk//2-1) == kk:
yield k
print(list(islice(agen(), 54))) # Michael S. Branicky, May 24 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Oct 02 2002
EXTENSIONS
Crossrefs section corrected and extended by M. F. Hasler, Jan 03 2020
STATUS
approved