%I M3816 #117 Feb 07 2024 01:15:46
%S 5,11,101,191,821,1481,1871,2081,3251,3461,5651,9431,13001,15641,
%T 15731,16061,18041,18911,19421,21011,22271,25301,31721,34841,43781,
%U 51341,55331,62981,67211,69491,72221,77261,79691,81041,82721,88811,97841,99131
%N Prime quadruples: numbers k such that k, k+2, k+6, k+8 are all prime.
%C Except for the first term, 5, all terms == 11 (mod 30). - _Zak Seidov_, Dec 04 2008
%C Some further values: For k = 1, ..., 10, a(k*10^3) = 11721791, 31210841, 54112601, 78984791, 106583831, 136466501, 165939791, 196512551, 230794301, 265201421. - _M. F. Hasler_, May 04 2009
%C k is the first prime of 2 consecutive twin prime pairs. - _Daniel Forgues_, Aug 01 2009
%C The prime quadruples of form p + (0, 2, 6, 8) have the quadruple congruence class (-1, +1, -1, +1) (mod 6). - _Daniel Forgues_, Aug 12 2009
%C s = (p+8)-(p) = 8 is the smallest s giving an admissible prime quadruple form, for which the only admissible form is p + (0, 2, 6, 8), since (0, 2, 6, 8) is the only form not covering all the congruence classes for any prime <= 4. Since s is smallest, these prime quadruples are prime constellations (or prime quadruplets), i.e., they contain consecutive primes. - _Daniel Forgues_, Aug 12 2009
%C Except for the first term, 5, all prime quadruples are of the form (15k-4, 15k-2, 15k+2, 15k+4), with k >= 1, and so are centered on 15k. - _Daniel Forgues_, Aug 12 2009
%C Subsequence of A022004. - _R. J. Mathar_, Feb 10 2013
%C The quadruplets are listed in A136162. - _M. F. Hasler_, Apr 20 2013
%C Starting at a(2) and examining the first 50 terms, (a(n)+4)/15 is a prime in 8 cases and a semiprime in 21; the last 18 terms have 2 primes and 11 semiprimes. Do the number of semiprimes continue to occur greater than mere chance? - _J. M. Bergot_, Apr 27 2015
%D H. Rademacher, Lectures on Elementary Number Theory. Blaisdell, NY, 1964, p. 4.
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H Matt C. Anderson, <a href="/A007530/b007530.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..1000 from T. D. Noe).
%H C. K. Caldwell, The Prime Glossary, <a href="https://t5k.org/glossary/page.php?sort=Quadruple">prime quadruple</a>
%H Tony Forbes and Norman Luhn, <a href="http://www.pzktupel.de/ktuplets">prime k-tuplets</a>
%H Ernest G. Hibbs, <a href="https://www.proquest.com/openview/4012f0286b785cd732c78eb0fc6fce80">Component Interactions of the Prime Numbers</a>, Ph. D. Thesis, Capitol Technology Univ. (2022), see p. 33.
%H Norman Luhn, <a href="http://www.pzktupel.de/smarchive.html">Table of n, a(n) for n = 1..1000000</a>
%H Thomas R. Nicely, <a href="https://faculty.lynchburg.edu/~nicely/quads/quads.html">Enumeration to 1.6e15 of the prime quadruplets</a>
%H H. Riesel, <a href="http://dx.doi.org/10.1007/978-0-8176-8298-9">Prime numbers and computer methods for factorization</a>, Progress in Mathematics, Vol. 57, Birkhäuser, Boston, 1985, ISBN: 978-0-8176-8297-2, Chap. 4, see p. 65.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/PrimeQuadruplet.html">Prime Quadruplet</a>
%F a(n) = 11 + 30*A014561(n-1) for n > 1. - _M. F. Hasler_, May 04 2009
%e From _M. F. Hasler_, May 04 2009: (Start)
%e a(1)=5 is the start of the first prime quadruplet, {5,7,11,13}.
%e a(2)=11 is the start of the second prime quadruplet, {11,13,17,19}, and all other prime quadruplets differ from this one by a multiple of 30.
%e a(100)=470081 is the start of the 100th prime quadruplet;
%e a(500)=4370081 is the start of the 500th prime quadruplet.
%e a(167)=1002341 is the least quadruplet prime beyond 10^6. (End)
%t A007530 = Select[Range[1, 10^5 - 1, 2], Union[PrimeQ[# + {0, 2, 6, 8}]] == {True} &] (* _Alonso del Arte_, Sep 24 2011 *)
%t Select[Prime[Range[10000]],AllTrue[#+{2,6,8},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Mar 11 2019 *)
%o (PARI) A007530( n, print_all=0, s=2 )={ my(p,q,r); until(!n--, until( p+8==s=nextprime(s+2), p=q; q=r; r=s); print_all && print1(p","));p} \\ The optional 3rd argument can be used to obtain large values by starting from some precomputed point instead of zero, using a(n+k) = A007530(k+1,,a(n)) (or A007530(k,,a(n)-1) for k>0); e.g., you get a(10^4+k) using A007530(k+1,,265201421) (value of a(10^4) from the comments section). - _M. F. Hasler_, May 04 2009
%o (PARI) forprime(p=2, 10^5, if(isprime(p+2) && isprime(p+6) && isprime(p+8), print1(p, ", "))) \\ _Felix Fröhlich_, Jun 22 2014
%o (Magma) [ p: p in PrimesUpTo(11000)| IsPrime(p+2) and IsPrime(p+6) and IsPrime(p+8)] // _Vincenzo Librandi_, Nov 18 2010
%o (Python)
%o from sympy import primerange
%o def aupto(limit):
%o p, q, r, alst = 2, 3, 5, []
%o for s in primerange(7, limit+9):
%o if p+2 == q and p+6 == r and p+8 == s: alst.append(p)
%o p, q, r = q, r, s
%o return alst
%o print(aupto(10**5)) # _Michael S. Branicky_, May 11 2021
%Y Cf. A159910 (first differences divided by 30), A120120, A007811, A014561.
%K nonn
%O 1,1
%A _N. J. A. Sloane_, _Robert G. Wilson v_
%E More terms from _Warut Roonguthai_
%E Incorrect formula and Mathematica program removed by _N. J. A. Sloane_, Dec 04 2008, at the suggestion of _Zak Seidov_
%E Values up to a(1000) checked with the given PARI code by _M. F. Hasler_, May 04 2009