OFFSET
1,1
EXAMPLE
11 is a term because 11*nextprime(11)+1 = 12^2 and 11 + nextprime(11)+1 = 5^2.
MAPLE
nn:=10^5:
for n from 1 to nn do:
p:=ithprime(n):q:=nextprime(p):p1:=sqrt(p*q+1):p2:=sqrt(q+p+1):
if floor(p1) = p1 and floor(p2)=p2
then
printf(`%d, `, p):
else
fi:
od:
MATHEMATICA
Select[Partition[Prime[Range[100000]], 2, 1], IntegerQ[Sqrt[#[[1]] + #[[2]] + 1]] && IntegerQ[Sqrt[#[[1]]*#[[2]] + 1]] &][[;; , 1]] (* Amiram Eldar, Sep 02 2024 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Sep 02 2024
STATUS
approved