login
Primes p such that p*nextprime(p)+1 and p + nextprime(p)+1 are both perfect squares where nextprime(p) is the smallest prime that is larger than p.
0

%I #11 Sep 13 2024 07:44:38

%S 3,11,59,179,311,419,2111,3119,5099,21011,21839,24419,30011,37811,

%T 41759,44699,60899,68819,83639,86111,100799,135719,143111,161879,

%U 163019,165311,177011,210599,218459,241511,273059,304979,312839,437111,450299,491039,584279,595139,603899,637319

%N Primes p such that p*nextprime(p)+1 and p + nextprime(p)+1 are both perfect squares where nextprime(p) is the smallest prime that is larger than p.

%e 11 is a term because 11*nextprime(11)+1 = 12^2 and 11 + nextprime(11)+1 = 5^2.

%p nn:=10^5:

%p for n from 1 to nn do:

%p p:=ithprime(n):q:=nextprime(p):p1:=sqrt(p*q+1):p2:=sqrt(q+p+1):

%p if floor(p1) = p1 and floor(p2)=p2

%p then

%p printf(`%d, `,p):

%p else

%p fi:

%p od:

%t Select[Partition[Prime[Range[100000]], 2, 1], IntegerQ[Sqrt[#[[1]] + #[[2]] + 1]] && IntegerQ[Sqrt[#[[1]]*#[[2]] + 1]] &][[;; , 1]] (* _Amiram Eldar_, Sep 02 2024 *)

%Y Intersection of A001359 and A242384.

%K nonn

%O 1,1

%A _Michel Lagneau_, Sep 02 2024