R. J. Cano, <a href="/A124598/b124598_1.txt">Table of n, a(n) for n = 1..10000</a>
R. J. Cano, <a href="/A124598/b124598_1.txt">Table of n, a(n) for n = 1..10000</a>
editing
approved
(PARI) findTerms(Pfinal)=my(k, t, L:list=List()); forprime(p=5, Pfinal, for(s=1, p, if(issquare(p-s, &k), if((k > 1) && ispseudoprime(t = (p-s)^2 + s), if((p<t) &&(s<(k+1)^2), listput(L, p); break))))); return(Vec(L)) \\ R. J. Cano, Apr 02 2018
(PARI) list(lim)=my(v=List(), k2, k4); lim\=1; for(k=2, sqrtint(lim-1), k2=k^2; k4=k2^2; forprime(p=k2+1, min(lim, 2*(k2+k)), if(isprime(k4+p-k2), listput(v, p)))); Set(v) \\ Charles R Greathouse IV, Apr 18 2018
nonn,changed,easy
(PARI) {m=19; v=[]; for(k=2, m, for(s=1, (k+1)^2-1, if((p=k^2+s)<m^2&&isprime(p)&&(q=k^4+s)>p&&isprime(q), v=concat(v, p)))); print(Set(v))} \\ _Klaus Brockhaus_, Mar 05 2007
(PARI) findTerms(Pfinal)={my(k, t, L:list=List()); forprime(p=5, Pfinal, for(s=1, p, if(issquare(p-s, &k), if((k > 1) && ispseudoprime(t = (p-s)^2 + s), if((p<t) &&(s<(k+1)^2), listput(L, p); break))))); return(Vec(L))} \\ R. J. Cano, Apr 02 2018
(PARI) upto(n) = {my(res = List()); forprime(p = 5, n, for(k = ceil(sqrt(p / 2 + 1/4) - 0.5), sqrtint(p-1), if(isprime(k^4 + p - k^2), listput(res, p); next(2)))); res} \\ David A. Corneth, Apr 08 2018
(PARI) list(lim)=my(v=List(), k2, k4); lim\=1; for(k=2, sqrtint(lim-1), k2=k^2; k4=k2^2; forprime(p=k2+1, min(lim, 2*(k2+k)), if(isprime(k4+p-k2), listput(v, p)))); Set(v) \\ Charles R Greathouse IV, Apr 18 2018
proposed
editing
editing
proposed
Using R. J. Cano's code, the primes less than a million not in this sequence are 2, 3, 13, 19, 73, 103, 113, 131, 223, 293, 313, 461, 761, 863, 1013, 1069, 1171, 1223, 2293, 2711, 2887, 2903, 4583, 5623, 6949, 7151, 7873, 8563, 8803, 12413, 13613, 16703, 17393, 22013, 24733, 28723. - David A. Corneth, Apr 08 2018
proposed
editing
editing
proposed
(PARI) findTerms(Pfinal)={my(k, t, L:list=List()); forprime(p=5, Pfinal, for(s=1, p, if(issquare(p-s, &k), if((k > 1) && ispseudoprime(t = (p-s)^2 + s), if((p<t) &&(s<(k+1)^2), listput(L, p); break))))); return(Vec(L))} \\ R. J. Cano, Apr 02 2018
(PARI) upto(n) = {my(res = List()); forprime(p = 5, n, for(k = ceil(sqrt(p / 2 + 1/4) - 0.5), sqrtint(p-1), if(isprime(k^4 + p - k^2), listput(res, p); next(2)))); res} \\ David A. Corneth, Apr 08 2018
proposed
editing