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-4 of 4 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

A124582 Primes p such that q-p >= 6, where q is the next prime after p.

Original entry on oeis.org

23, 31, 47, 53, 61, 73, 83, 89, 113, 131, 139, 151, 157, 167, 173, 181, 199, 211, 233, 241, 251, 257, 263, 271, 283, 293, 317, 331, 337, 353, 359, 367, 373, 383, 389, 401, 409, 421, 433, 443, 449, 467, 479, 491, 503, 509, 523, 541, 547, 557, 563, 571, 577
Offset: 1

Views

Author

N. J. A. Sloane, Dec 19 2006

Keywords

Crossrefs

Complement of A124589.

Programs

  • Maple
    d:=6; M:=1000; t0:=[]; for n from 1 to M do p:=ithprime(n); if nextprime(p) - p >= d then t0:=[op(t0),p]; fi; od: t0;
  • Mathematica
    t={};q=6;Do[If[Prime[n+6]-Prime[n+5]>=q,AppendTo[t,Prime[n+5]]],{n,1,200}];t (* Vladimir Joseph Stephan Orlovsky, Feb 02 2012 *)
    Transpose[Select[Partition[Prime[Range[200]],2,1],#[[2]]-#[[1]] >= 6&]] [[1]] (* Harvey P. Dale, May 15 2013 *)
  • PARI
    is(n)=!isprime(n+2) && !isprime(n+4) && n>2 && isprime(n) \\ Charles R Greathouse IV, Jun 04 2015

Formula

a(n) ~ n log n. - Charles R Greathouse IV, Jun 04 2015

A124588 Primes p such that q - p <= 2, where q is the next prime after p.

Original entry on oeis.org

2, 3, 5, 11, 17, 29, 41, 59, 71, 101, 107, 137, 149, 179, 191, 197, 227, 239, 269, 281, 311, 347, 419, 431, 461, 521, 569, 599, 617, 641, 659, 809, 821, 827, 857, 881, 1019, 1031, 1049, 1061, 1091, 1151, 1229, 1277, 1289, 1301, 1319, 1427, 1451, 1481, 1487, 1607
Offset: 1

Views

Author

N. J. A. Sloane, Dec 19 2006; edited May 15 2008 at the suggestion of R. J. Mathar

Keywords

Comments

Consists of 2 together with the lower members of twin primes, A001359. See the latter entry for references.
"Assuming certain (admittedly difficult) conjectures on the distribution of primes in arithmetic progressions, [Goldston-Pintz-Yildirim] prove the existence of infinitely many prime pairs that differ at most by 16." - Soundararajan
Lesser of twin primes together with 2; union with A029710 gives A124589. - Reinhard Zumkeller, Dec 23 2006
Primes p such that either p + 3/2 +- 1/2 is prime. - Juri-Stepan Gerasimov, Jan 29 2010
The prime differences of 2 primes (without repetition). - Juri-Stepan Gerasimov, Jun 01 2010, Jun 08 2010
Numbers k such that sigma(k*(k+2)) = (k+1)*(k+3). - Wesley Ivan Hurt, May 08 2022

Crossrefs

Cf. A001359.

Programs

  • Mathematica
    Transpose[Select[Partition[Prime[Range[300]],2,1],#[[2]]-#[[1]]<3&]] [[1]] (* Harvey P. Dale, Feb 11 2015 *)
  • PARI
    twinl(n) = { c=0; x=1; while(cCino Hilliard, Mar 29 2008

A124590 Primes p such that q-p <= 6, where q is the next prime after p.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 97, 101, 103, 107, 109, 127, 131, 137, 149, 151, 157, 163, 167, 173, 179, 191, 193, 197, 223, 227, 229, 233, 239, 251, 257, 263, 269, 271, 277, 281, 307, 311, 313, 331, 347, 349, 353, 367
Offset: 1

Views

Author

N. J. A. Sloane, Dec 19 2006

Keywords

Comments

Goldston, Graham, Pintz, & Yilidirm give a conditional proof that this sequence is infinite; see their Theorem 4. - Charles R Greathouse IV, Jul 31 2013

Crossrefs

Programs

  • PARI
    v=List([2]);p=3;forprime(q=5,1e3,if(q-p<=6,listput(v,p));p=q);Vec(v) \\ Charles R Greathouse IV, Jul 31 2013
    
  • PARI
    list(lim)=my(v=List(),p=2); forprime(q=3,nextprime(lim\1+1), if(q-p<7, listput(v,p)); p=q); Vec(v) \\ Charles R Greathouse IV, Jan 31 2017

Formula

A000040 MINUS A083371. - R. J. Mathar, Jun 15 2008
A124589 UNION A031924. - R. J. Mathar, Jan 23 2022
a(n) >> n log^2 n. - Charles R Greathouse IV, Jan 31 2017
Showing 1-4 of 4 results.