login
A360567
Primes p such that the nearest integer to sqrt(p) is also prime.
1
3, 5, 7, 11, 23, 29, 43, 47, 53, 113, 127, 131, 157, 163, 167, 173, 179, 181, 277, 281, 283, 293, 347, 349, 353, 359, 367, 373, 379, 509, 521, 523, 541, 547, 821, 823, 827, 829, 839, 853, 857, 859, 863, 937, 941, 947, 953, 967, 971, 977, 983, 991, 1361
OFFSET
1,1
LINKS
EXAMPLE
sqrt(11) = 3.3166247..., which when rounded is 3, and both 3 and 11 are prime, so 11 is in the sequence.
MAPLE
R:= NULL: count:= 0:
q:=1:
while count < 100 do
q:= nextprime(q);
p:= floor((q-1/2)^2);
u:= (q+1/2)^2;
while count < 100 do
p:= nextprime(p);
if p > u then break fi;
R:= R, p; count:= count+1;
od
od:
R; # Robert Israel, Mar 29 2023
MATHEMATICA
Select[Prime[Range[500]], PrimeQ[Round[Sqrt[#]]] &]
PROG
(Python)
from itertools import islice
from math import isqrt
from sympy import isprime, nextprime
def A360567_gen(): # generator of terms
p = 1
while p:=nextprime(p):
if isprime((m:=isqrt(p))+int(p-m*(m+1)>=1)):
yield p
A360567_list = list(islice(A360567_gen(), 20)) # Chai Wah Wu, Feb 27 2023
CROSSREFS
Sequence in context: A325155 A038890 A227240 * A226017 A303705 A309520
KEYWORD
nonn
AUTHOR
Rhys Feltman, Feb 11 2023
STATUS
approved