login
Primes p such that (2^p+p^2)/3 is prime.
0

%I #20 Jun 25 2022 03:59:30

%S 5,7,17,43,61,73,241,739,1297,4211,98519

%N Primes p such that (2^p+p^2)/3 is prime.

%C No more terms < 50000.

%C Intersection with A242929 (primes p such that 2^p-p^2 is prime) includes 5, 7 and 17. Any others?

%e a(3) = 17 is a term because (2^17+17^2)/3 = 43787 is prime.

%p filter:= proc(p) isprime(p) and isprime((2^p+p^2)/3) end proc:

%p select(filter, [seq(i,i=5..10000,2)]);

%t Select[Prime[Range[600]], PrimeQ[(2^# + #^2)/3] &] (* _Amiram Eldar_, Jun 23 2022 *)

%o (PARI) isok(p) = if (isprime(p), my(q=(2^p+p^2)/3); (denominator(q)==1) && ispseudoprime(q)); \\ _Michel Marcus_, Jun 23 2022

%o (Python)

%o from itertools import islice

%o from sympy import isprime, nextprime

%o def agen():

%o p = 2

%o while True:

%o t = 2**p+p**2

%o if t%3 == 0 and isprime(t//3):

%o yield p

%o p = nextprime(p)

%o print(list(islice(agen(), 10))) # _Michael S. Branicky_, Jun 23 2022

%Y Cf. A242929.

%K nonn,more

%O 1,1

%A _J. M. Bergot_ and _Robert Israel_, Jun 23 2022

%E a(11) from _Daniel Suteu_, Jun 25 2022