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-2 of 2 results.

A022885 Primes p=prime(k) such that prime(k) + prime(k+3) = prime(k+1) + prime(k+2).

Original entry on oeis.org

5, 7, 11, 13, 23, 37, 53, 73, 97, 101, 103, 109, 137, 157, 179, 191, 223, 251, 263, 307, 353, 373, 389, 409, 419, 433, 457, 479, 487, 541, 563, 571, 593, 683, 691, 701, 757, 809, 821, 853, 859, 877, 883, 911, 977, 1019, 1039, 1049, 1087, 1103
Offset: 1

Views

Author

Keywords

Comments

These are primes p for which the subsequent alternate prime gaps are equal, so (p(k+3)-p(k+2))/(p(k+1)-p(k)) = 1. It is conjectured that the most frequent alternate prime gaps ratio is one. - Andres Cicuttin, Nov 07 2016

Examples

			Starting from 5, the four consecutive primes are 5, 7, 11, 13; and they satisfy 5 + 13 = 7 + 11. So 5 is in the sequence.
		

Crossrefs

Programs

  • Magma
    [NthPrime(n): n in [1..200] | (NthPrime(n)+NthPrime(n+3)) eq (NthPrime(n+1)+NthPrime(n+2))]; // Vincenzo Librandi, Nov 08 2016
    
  • Mathematica
    Transpose[Select[Partition[Prime[Range[500]],4,1],First[#]+Last[#] == #[[2]]+#[[3]]&]][[1]] (* Harvey P. Dale, May 23 2011 *)
  • PARI
    isok(p) = {my(k = primepi(p)); (p == prime(k)) && ((prime(k) + prime(k+3)) == (prime(k+1) + prime(k+2)));} \\ Michel Marcus, Jan 15 2014
    
  • Python
    from sympy import nextprime
    from itertools import islice
    def agen(): # generator of terms
        p, q, r, s = [2, 3, 5, 7]
        while True:
            if p + s == q + r: yield p
            p, q, r, s = q, r, s, nextprime(s)
    print(list(islice(agen(), 50))) # Michael S. Branicky, May 31 2024

Formula

a(n) = A000040(A022884(n)). - Amiram Eldar, May 06 2020

Extensions

Name edited by Michel Marcus, Jan 15 2014

A022884 Numbers k such that prime(k) + prime(k+3) = prime(k+1) + prime(k+2).

Original entry on oeis.org

3, 4, 5, 6, 9, 12, 16, 21, 25, 26, 27, 29, 33, 37, 41, 43, 48, 54, 56, 63, 71, 74, 77, 80, 81, 84, 88, 92, 93, 100, 103, 105, 108, 124, 125, 126, 134, 140, 142, 147, 149, 151, 153, 156, 165, 171, 175, 176, 181, 185, 191, 200, 208, 211, 216, 224, 234, 235
Offset: 1

Views

Author

Keywords

Examples

			The ninth prime is 23. We verify that 23 + 37 = 60 = 29 + 31. Hence 9 is in the sequence.
The tenth prime is 29. We see that 29 + 41 = 70 but 31 + 37 = 68, so 10 is not in the sequence.
		

Crossrefs

Cf. A261470. - Altug Alkan, Oct 28 2015

Programs

  • Magma
    [n: n in [1..250] |(NthPrime(n)+NthPrime(n+3)) eq (NthPrime(n+1)+ NthPrime(n+2))]; // Vincenzo Librandi, Nov 04 2018
  • Mathematica
    Select[Range@ 240, Prime[#] + Prime[# + 3] == Prime[# + 1] + Prime[# + 2] &] (* Michael De Vlieger, Oct 28 2015 *)
  • PARI
    isok(k) = prime(k+3)+prime(k) == prime(k+1)+prime(k+2); \\ Michel Marcus, Aug 20 2015
    
  • PARI
    is(n,p=prime(n))=my(q=nextprime(p+1),r=nextprime(q+1),s=nextprime(r+1)); p+s==q+r
    n=0; forprime(p=2,1e5, if(is(n++,p), print1(n", "))) \\ Charles R Greathouse IV, Oct 28 2015
    

Formula

a(n) = A000720(A022885(n)). - Zak Seidov, Oct 23 2015

Extensions

Name edited by Michel Marcus, Aug 20 2015
Showing 1-2 of 2 results.