login
Primes of the form p+q*(r+s), where p,q,r,s are consecutive primes.
2

%I #9 Apr 15 2021 22:55:02

%S 173,337,479,727,1399,2447,3727,10859,11897,22349,23857,26267,80963,

%T 105097,112069,170081,191861,243931,276343,284593,613181,665213,

%U 771863,827521,862607,951413,1050449,1158961,1334093,1380259,1435519,1495517,1584983,1660697,1745581,1847861,1929569,2067529

%N Primes of the form p+q*(r+s), where p,q,r,s are consecutive primes.

%C a(n) = p+q*(r+s) where p = A343448(n) and q,r,s are the next three primes after p.

%H Robert Israel, <a href="/A343449/b343449.txt">Table of n, a(n) for n = 1..10000</a>

%e For n = 3, A343448(3) = 11 and the next three primes are 13, 17, 19, so a(3) = 11+13*(17+19) = 479.

%p B:= NULL: q:= 2: r:= 3: s:= 5: count:= 0:

%p while count < 100 do

%p p:= q; q:= r; r:= s; s:= nextprime(s);

%p v:= p+q*(r+s);

%p if isprime(v) then B:= B,v; count:= count+1 fi

%p od:

%p B;

%o (Python)

%o from sympy import isprime, nextprime

%o def aupto(limit):

%o p, q, r, s, alst = 2, 3, 5, 7, []

%o t = p + q*(r+s)

%o while t <= limit:

%o if isprime(t): alst.append(t)

%o p, q, r, s = q, r, s, nextprime(s)

%o t = p + q*(r+s)

%o return alst

%o print(aupto(2067529)) # _Michael S. Branicky_, Apr 15 2021

%Y Cf. A343448.

%K nonn

%O 1,1

%A _J. M. Bergot_ and _Robert Israel_, Apr 15 2021