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.

A029710 Primes such that next prime is 4 greater.

This page as a plain text file.
%I A029710 #45 Sep 08 2022 08:44:50
%S A029710 7,13,19,37,43,67,79,97,103,109,127,163,193,223,229,277,307,313,349,
%T A029710 379,397,439,457,463,487,499,613,643,673,739,757,769,823,853,859,877,
%U A029710 883,907,937,967,1009,1087,1093,1213,1279,1297,1303,1423,1429
%N A029710 Primes such that next prime is 4 greater.
%C A029710 Union with A124588 gives A124589. - _Reinhard Zumkeller_, Dec 23 2006
%C A029710 For any prime p > 3, if p + 4 is prime then necessarily it is the next prime. But there cannot be three consecutive primes with mutual distance 4: If p and p + 4 are prime, then p+8 is an odd multiple of 3 (cf. formula). - _M. F. Hasler_, Jan 15 2013
%C A029710 The smaller members p of cousin prime pairs (p,p+4) excluding p=3. - _Marc Morgenegg_, Apr 19 2016
%H A029710 Marius A. Burtea, <a href="/A029710/b029710.txt">Table of n, a(n) for n = 1..14741</a> ( first 1000 terms from R. Zumkeller )
%H A029710 <a href="/index/Pri#gaps">Index entries for primes, gaps between</a>
%F A029710 a(n) = A031505(n + 1) - 4 = A029708(n) - 2.
%F A029710 a(n) = 1 (mod 6) for all n; (a(n) + 2)/3 = A157834(n), i.e., a(n) = 3*A157834(n) - 2. - _M. F. Hasler_, Jan 15 2013
%e A029710 79 is a term as the next prime is 79 + 4 = 83. 3 is not a term even though 3 + 4 = 7 is prime, since it is not the next one.
%p A029710 for i from 1 to 226 do if ithprime(i+1) = ithprime(i) + 4 then print({ithprime(i)}); fi; od; # _Zerinvary Lajos_, Mar 19 2007
%t A029710 Select[Prime[Range[225]], NextPrime[#] == # + 4 &] (* _Alonso del Arte_, Jan 17 2013 *)
%t A029710 Transpose[Select[Partition[Prime[Range[300]],2,1],#[[2]]-#[[1]]==4&]] [[1]] (* _Harvey P. Dale_, Mar 28 2016 *)
%o A029710 (PARI) forprime(p=1, 1e4, if(nextprime(p+1)-p==4, print1(p, ", "))) \\ _Felix Fröhlich_, Aug 16 2014
%o A029710 (Magma) [p:p in PrimesUpTo(1700)| IsPrime(p+4) and NextPrime(p) eq p+4] // _Marius A. Burtea_, Jan 24 2019
%o A029710 (MATLAB)
%o A029710 p=primes(1700);m=1;
%o A029710 for u=1:length(p)-4
%o A029710    if and(isprime(p(u)+4)==1,p(u+1)==p(u)+4);sol(m)=p(u);m=m+1;end
%o A029710 end
%o A029710 sol % _Marius A. Burtea_, Jan 24 2019
%Y A029710 Essentially the same as A023200.
%Y A029710 Cf. A001359, A029708, A031505, A124588, A124589, A157834.
%K A029710 nonn
%O A029710 1,1
%A A029710 _N. J. A. Sloane_