login
Primes p such that 2*p + 31 is a square.
1

%I #23 Sep 08 2022 08:46:16

%S 97,349,997,1609,2797,3769,6829,7549,10789,11689,13597,15649,16729,

%T 22669,28069,32497,40597,44089,49597,59497,63709,70297,74869,86929,

%U 89449,94597,113749,122497,128509,144169,147409,153997,164149,181789,196549,200329,207997

%N Primes p such that 2*p + 31 is a square.

%C Primes of the form 2*k^2 + 2*k - 15.

%t Select[Prime[Range[25000]], IntegerQ[Sqrt[2 # + 31]] &]

%o (Magma) [p: p in PrimesUpTo(300000) | IsSquare(2*p+31)];

%o (PARI) lista(nn) = forprime(p=2, nn, if (issquare(2*p+31), print1(p, ", "))); \\ _Michel Marcus_, Mar 22 2016

%o (Python)

%o from gmpy2 import is_prime,is_square

%o for p in range(3,10**6,2):

%o if(not is_square(2*p+31)):continue

%o elif(is_prime(p)):print(p)

%o # _Soumil Mandal_, Apr 07 2016

%Y Cf. A000040.

%Y Subsequence of A061241, A142108.

%Y Cf. similar sequences listed in A269784.

%K nonn

%O 1,1

%A _Vincenzo Librandi_, Mar 22 2016