%I #109 Feb 04 2024 01:10:26
%S 5,11,17,41,101,107,191,227,311,347,461,641,821,857,881,1091,1277,
%T 1301,1427,1481,1487,1607,1871,1997,2081,2237,2267,2657,2687,3251,
%U 3461,3527,3671,3917,4001,4127,4517,4637,4787,4931,4967,5231,5477
%N Initial members of prime triples (p, p+2, p+6).
%C Subsequence of A001359. - _R. J. Mathar_, Feb 10 2013
%C All terms are congruent to 5 (mod 6). - _Matt C. Anderson_, May 22 2015
%C Intersection of A001359 and A023201. - _Zak Seidov_, Mar 12 2016
%H Matt C. Anderson <a href="/A022004/b022004.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..1000 from T. D. Noe)
%H T. Forbes and Norman Luhn <a href="http://www.pzktupel.de/ktuplets">Prime k-tuplets</a>
%H R. J. Mathar, <a href="/A022004/a022004_1.pdf">Table of Prime Gap Constellations</a>
%H Thomas R. Nicely, <a href="https://faculty.lynchburg.edu/~nicely/triples/t3a_0000.htm">Enumeration of the prime triples (q,q+2,q+6) to 1e16</a>.
%H P. Pollack, <a href="http://www.math.dartmouth.edu/~ppollack/notes.pdf">Analytic and Combinatorial Number Theory</a>, Course Notes, p. 132, ex. 3.4.3. [Broken link?]
%H P. Pollack, <a href="http://alpha01.dm.unito.it/personalpages/cerruti/ac/notes.pdf">Analytic and Combinatorial Number Theory</a>, Course Notes, p. 132, ex. 3.4.3.
%H Maxie D. Schmidt, <a href="https://arxiv.org/abs/1701.04741">New Congruences and Finite Difference Equations for Generalized Factorial Functions</a>, arXiv:1701.04741 [math.CO], 2017.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/PrimeTriplet.html">Prime Triplet</a>
%p A022004 := proc(n)
%p if n= 1 then
%p 5;
%p else
%p for a from procname(n-1)+2 by 2 do
%p if isprime(a) and isprime(a+2) and isprime(a+6) then
%p return a;
%p end if;
%p end do:
%p end if;
%p end proc: # _R. J. Mathar_, Jul 11 2012
%t Select[Prime[Range[1000]], PrimeQ[#+2] && PrimeQ[#+6]&] (* _Vladimir Joseph Stephan Orlovsky_, Mar 30 2011 *)
%t Transpose[Select[Partition[Prime[Range[1000]],3,1],Differences[#]=={2,4}&]][[1]] (* _Harvey P. Dale_, Dec 24 2011 *)
%o (Magma) [ p: p in PrimesUpTo(10000) | IsPrime(p+2) and IsPrime(p+6) ] // _Vincenzo Librandi_, Nov 19 2010
%o (PARI) is(n)=isprime(n)&&isprime(n+2)&&isprime(n+6) \\ _Charles R Greathouse IV_, Jul 01 2013
%o (Python)
%o from sympy import primerange
%o def aupto(limit):
%o p, q, alst = 2, 3, []
%o for r in primerange(5, limit+7):
%o if p+2 == q and p+6 == r: alst.append(p)
%o p, q = q, r
%o return alst
%o print(aupto(5477)) # _Michael S. Branicky_, May 11 2021
%Y Cf. A073648, A098412.
%Y Cf. A001359, A023201.
%Y Subsequence of A007529.
%K nonn,easy
%O 1,1
%A _Warut Roonguthai_
|