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.

Showing 1-5 of 5 results.

A029710 Primes such that next prime is 4 greater.

Original entry on oeis.org

7, 13, 19, 37, 43, 67, 79, 97, 103, 109, 127, 163, 193, 223, 229, 277, 307, 313, 349, 379, 397, 439, 457, 463, 487, 499, 613, 643, 673, 739, 757, 769, 823, 853, 859, 877, 883, 907, 937, 967, 1009, 1087, 1093, 1213, 1279, 1297, 1303, 1423, 1429
Offset: 1

Views

Author

Keywords

Comments

Union with A124588 gives A124589. - Reinhard Zumkeller, Dec 23 2006
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
The smaller members p of cousin prime pairs (p,p+4) excluding p=3. - Marc Morgenegg, Apr 19 2016

Examples

			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.
		

Crossrefs

Essentially the same as A023200.

Programs

  • MATLAB
    p=primes(1700);m=1;
    for u=1:length(p)-4
       if and(isprime(p(u)+4)==1,p(u+1)==p(u)+4);sol(m)=p(u);m=m+1;end
    end
    sol % Marius A. Burtea, Jan 24 2019
  • Magma
    [p:p in PrimesUpTo(1700)| IsPrime(p+4) and NextPrime(p) eq p+4] // Marius A. Burtea, Jan 24 2019
    
  • Maple
    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
  • Mathematica
    Select[Prime[Range[225]], NextPrime[#] == # + 4 &] (* Alonso del Arte, Jan 17 2013 *)
    Transpose[Select[Partition[Prime[Range[300]],2,1],#[[2]]-#[[1]]==4&]] [[1]] (* Harvey P. Dale, Mar 28 2016 *)
  • PARI
    forprime(p=1, 1e4, if(nextprime(p+1)-p==4, print1(p, ", "))) \\ Felix Fröhlich, Aug 16 2014
    

Formula

a(n) = A031505(n + 1) - 4 = A029708(n) - 2.
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

A087679 Numbers k such that both k+2 and k-2 are prime.

Original entry on oeis.org

5, 9, 15, 21, 39, 45, 69, 81, 99, 105, 111, 129, 165, 195, 225, 231, 279, 309, 315, 351, 381, 399, 441, 459, 465, 489, 501, 615, 645, 675, 741, 759, 771, 825, 855, 861, 879, 885, 909, 939, 969, 1011, 1089, 1095, 1215, 1281, 1299, 1305, 1425, 1431, 1449, 1485
Offset: 1

Views

Author

Zak Seidov, Sep 27 2003

Keywords

Comments

Essentially the same as A029708: a(n) = A029708(n-1) for n>=2.
Midpoint of cousin prime pairs.
The only prime is 5. All other terms are multiples of 3. - Zak Seidov, May 19 2014

Crossrefs

Programs

  • Maple
    ZL:=[]:for p from 1 to 1485 do if (isprime(p) and isprime(p+4) ) then ZL:=[op(ZL),(p+(p+4))/2]; fi; od; print(ZL); # Zerinvary Lajos, Mar 07 2007
  • Mathematica
    lst={};Do[If[PrimeQ[n-2]&&PrimeQ[n+2],AppendTo[lst,n]],{n,3,8!,2}];lst (* Vladimir Joseph Stephan Orlovsky, Jan 14 2009 *)
  • PARI
    s=[]; for(n=1, 2000, if(isprime(n-2) && isprime(n+2), s=concat(s, n))); s \\ Colin Barker, May 19 2014
    
  • PARI
    is_A087679(n)={isprime(n-2) && isprime(n+2)} \\ For numbers >> 10^12 one should add conditions {n%6==3 && ... || n==5} or consider only such numbers congruent to 3 (mod 6). - M. F. Hasler, Apr 05 2017

Formula

a(n) = (A023200(n) + A046132(n))/2 = A023200(n) + 2 = A046132(n) - 2.
a(n+1) = A056956(n)*6 + 3 = A157834(n)*3; a(n) = A088762(n)*2 + 1. - M. F. Hasler, Apr 05 2017

Extensions

More terms from Ray Chandler, Oct 26 2003

A031505 Upper prime of a difference of 4 between consecutive primes.

Original entry on oeis.org

11, 17, 23, 41, 47, 71, 83, 101, 107, 113, 131, 167, 197, 227, 233, 281, 311, 317, 353, 383, 401, 443, 461, 467, 491, 503, 617, 647, 677, 743, 761, 773, 827, 857, 863, 881, 887, 911, 941, 971, 1013, 1091, 1097, 1217, 1283, 1301, 1307, 1427, 1433, 1451
Offset: 1

Views

Author

Keywords

Crossrefs

Essentially the same as A046132.

Programs

  • Maple
    for i from 1 to 232 do if ithprime(i+1) = ithprime(i) + 4 then print({ithprime(i+1)}); fi; od; # Zerinvary Lajos, Mar 19 2007
  • Mathematica
    Select[Partition[Prime[Range[250]],2,1],#[[2]]-#[[1]]==4&][[All,2]] (* Harvey P. Dale, Feb 02 2023 *)

Formula

a(n) = A029710(n-1) + 4 = A029708(n) + 2.

Extensions

Corrected and extended by Henry Bottomley, Jul 18 2000
Definition clarified by Harvey P. Dale, Feb 02 2023

A157834 Numbers n such that 3n-2 and 3n+2 are both prime.

Original entry on oeis.org

3, 5, 7, 13, 15, 23, 27, 33, 35, 37, 43, 55, 65, 75, 77, 93, 103, 105, 117, 127, 133, 147, 153, 155, 163, 167, 205, 215, 225, 247, 253, 257, 275, 285, 287, 293, 295, 303, 313, 323, 337, 363, 365, 405, 427, 433, 435, 475, 477, 483, 495, 497, 517
Offset: 1

Views

Author

Kyle D. Balliet, Mar 07 2009

Keywords

Comments

Barycenter of cousin primes (A029708; see also A029710, A023200, A046132), divided by 3. When p>3 and p+4 both are prime, then p = 1 (mod 6) and p+2 = 3 (mod 6). - M. F. Hasler, Jan 14 2013

Examples

			15*3 +/- 2 = 43,47 (both prime).
		

Crossrefs

Intersection of A024893 and A153183.

Programs

  • Magma
    [n: n in [1..1000]|IsPrime(3*n-2)and IsPrime(3*n+2)] // Vincenzo Librandi, Dec 13 2010
  • Maple
    select(t -> isprime(3*t+2) and isprime(3*t-2), [seq(t,t=3..1000,2)]); # Robert Israel, May 28 2017
  • Mathematica
    Select[Range[600],AllTrue[3#+{2,-2},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Feb 03 2019 *)

Formula

Intersection of A024893 and A153183.
a(n) = A029708(n)/3. - Zak Seidov, Aug 07 2009
a(n) = A056956(n)*2+1 = (A029710(n)+2)/3 = (A023200(n+1)+2)/3. - M. F. Hasler, Jan 14 2013

A111981 Numbers n such that 2n-1 and 2n+3 are consecutive primes.

Original entry on oeis.org

4, 7, 10, 19, 22, 34, 40, 49, 52, 55, 64, 82, 97, 112, 115, 139, 154, 157, 175, 190, 199, 220, 229, 232, 244, 250, 307, 322, 337, 370, 379, 385, 412, 427, 430, 439, 442, 454, 469, 484, 505, 544, 547, 607, 640, 649, 652, 712, 715, 724, 742, 745, 775, 784, 790
Offset: 1

Views

Author

Ray Chandler, Aug 24 2005

Keywords

Crossrefs

Essentially the same as A088762.

Formula

a(n) = (A029708(n)-1)/2 = (A029710(n)+1)/2 = (A031505(n)-3)/2.
Showing 1-5 of 5 results.