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.
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
Keywords
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.
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
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
Comments