cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A340408 Primes p such that p*q+q*r+r*s is prime, where q,r,s are the next primes after p.

This page as a plain text file.
%I A340408 #12 Mar 17 2021 13:07:43
%S A340408 3,17,19,23,43,151,157,199,229,233,331,347,461,467,491,503,523,547,
%T A340408 563,613,617,619,653,739,743,773,941,1021,1031,1051,1063,1097,1103,
%U A340408 1117,1163,1193,1237,1259,1279,1373,1429,1489,1523,1553,1601,1609,1613,1627,1663,1709,1733,1907,1999,2011,2087
%N A340408 Primes p such that p*q+q*r+r*s is prime, where q,r,s are the next primes after p.
%H A340408 Robert Israel, <a href="/A340408/b340408.txt">Table of n, a(n) for n = 1..10000</a>
%e A340408 a(3) = 19 is a term because 19*23+23*29+29*31 = 2003 is prime.
%p A340408 q:= 2: r:= 3: s:= 5:
%p A340408 count:= 0: R:= NULL:
%p A340408 while count < 100 do
%p A340408   p:= q; q:= r; r:= s; s:= nextprime(s);
%p A340408   if isprime(p*q+q*r+r*s) then count:= count+1; R:= R, p;  fi
%p A340408 od:
%p A340408 R;
%o A340408 (Python)
%o A340408 from sympy import isprime, nextprime
%o A340408 def aupton(terms):
%o A340408   p, q, r, s, alst = 2, 3, 5, 7, []
%o A340408   while len(alst) < terms:
%o A340408     if isprime(p*q + q*r + r*s): alst.append(p)
%o A340408     p, q, r, s = q, r, s, nextprime(s)
%o A340408   return alst
%o A340408 print(aupton(55)) # _Michael S. Branicky_, Mar 17 2021
%Y A340408 Cf. A287653.
%K A340408 nonn
%O A340408 1,1
%A A340408 _J. M. Bergot_ and _Robert Israel_, Jan 06 2021