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.

A127566 Primes p such that at least one of k-1, k+1 is prime, where k = absolute value of q^2 - p*r and p, q, r are consecutive primes.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 59, 61, 67, 71, 73, 83, 89, 97, 101, 103, 107, 113, 127, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 271, 277, 281, 283, 307, 311, 317, 331
Offset: 1

Views

Author

J. M. Bergot, Apr 02 2007

Keywords

Comments

k is always an even number.
Agrees with A049545 for the first 26 terms; first divergence is at 109.

Examples

			31, 37, 41 are consecutive primes, 31^2 - 37*41 = -556. 557 is prime, hence 31 is a term.
53, 59, 61 are consecutive primes, 59^2 - 53*61 = 248. Both 247 = 13*19 and 249 = 3*83 are composite, hence 53 is not in the sequence.
		

Crossrefs

Cf. A049545.

Programs

  • Magma
    [ p: p in PrimesInInterval(2, 335) | IsPrime(k-1) or IsPrime(k+1) where k is Abs(q^2 - p*r) where r is NextPrime(q) where q is NextPrime(p) ]; /* Klaus Brockhaus, Apr 06 2007 */
  • Mathematica
    Transpose[Select[Partition[Prime[Range[70]],3,1],Or@@PrimeQ[Abs[ #[[2]]^2- #[[1]]*#[[3]]]+{1,-1}]&]][[1]] (* Harvey P. Dale, Oct 28 2013 *)

Extensions

Edited and extended by Klaus Brockhaus, Apr 06 2007