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.

A124661 Primes prime(n) such that prime(n-k)+prime(n+k) >= 2*prime(n) for k = 1..n-2.

Original entry on oeis.org

2, 3, 5, 7, 13, 19, 23, 31, 43, 47, 73, 83, 109, 113, 181, 199, 283, 293, 313, 317, 463, 467, 503, 509, 523, 619, 661, 683, 691, 887, 1063, 1069, 1103, 1109, 1123, 1129, 1303, 1307, 1321, 1327, 1613, 1621, 1627, 1637, 1669, 1789
Offset: 1

Views

Author

Artur Jasinski, Dec 23 2006

Keywords

Comments

The first two primes, 2 and 3, are tested against an empty set of k, and we include them, defining such a test to have a positive outcome.
McNew's "popular primes" sequence (A385503) has the same first 14 terms, differing first by excluding 181. McNew says that a prime p is "popular" on an interval [2, k] if no prime occurs more frequently than p as the greatest prime factor (gpf, A006530) of the integers in that interval. - N. J. A. Sloane, Jul 25 2017 and Peter Munn, Jul 01 2025
See the Pomerance link for a proof that the sequence is infinite. - Peter Munn, Jul 01 2025

Examples

			prime(11)=31 is in the sequence because prime(10)+prime(12) = 66, prime(9)+prime(13) = 64,..., prime(2)+prime(20) = 74 are all >= 62 = 2*31.
prime(10) = 29 is not in the sequence because prime(9)+prime(11) = 54 for example is smaller than 58 = 2*29.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime@ Range@ 300, Function[{p, n}, NoneTrue[Range[n - 2], Prime[n - #] + Prime[n + #] < 2 p &]] @@ {#, PrimePi@ #} &] (* Michael De Vlieger, Jul 25 2017 *)
  • PARI
    isok(p) = {n = primepi(p); for (k=1, n-2, if (prime(n-k) + prime(n+k) < 2*p, return (0));); return (1);}
    lista(nn) = {for(n=1, nn, if (isok(prime(n)), print1(prime(n), ", ");););} \\ Michel Marcus, Nov 03 2013
    
  • Python
    from sympy import prime
    A124661_list = []
    for n in range(1,10**6):
        p = prime(n)
        for k in range(1,n-1):
            if prime(n-k)+prime(n+k) < 2*p:
                break
        else:
            A124661_list.append(p) # Chai Wah Wu, Jul 25 2017

Extensions

Sequence extended by R. J. Mathar, Mar 28 2010
Edited, restoring previous name, by Peter Munn, Jul 01 2025