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.

A058620 Lesser of two consecutive primes whose difference divided by two is a prime: ( prime(next prime after n) - prime(n) )/2 is prime.

Original entry on oeis.org

7, 13, 19, 23, 31, 37, 43, 47, 53, 61, 67, 73, 79, 83, 97, 103, 109, 113, 127, 131, 139, 151, 157, 163, 167, 173, 181, 193, 223, 229, 233, 241, 251, 257, 263, 271, 277, 283, 293, 307, 313, 317, 331, 337, 349, 353, 367, 373, 379, 383, 397, 409, 421, 433, 439
Offset: 1

Views

Author

Robert G. Wilson v, Dec 28 2000

Keywords

Comments

Lesser of two consecutive primes whose difference is a semiprime (A001358). - Zak Seidov, Nov 19 2016

Crossrefs

Cf. A001358.

Programs

  • Mathematica
    Do[ If[ PrimeQ[ (Prime[n + 1] - Prime[n] )/2], Print[ Prime[n] ]], {n, 1, 100} ]
    p=7;Reap[Do[If[PrimeQ[((q=NextPrime[p])-p)/2],Sow[p]];p=q,{100}]][[2, 1]] (* Zak Seidov, Nov 19 2016 *)
    Select[Partition[Prime[Range[100]],2,1],PrimeQ[(#[[2]]-#[[1]])/2]&][[All,1]] (* Harvey P. Dale, Jan 20 2021 *)
  • PARI
    isok(p) = isprime(p) && isprime((nextprime(p+1) - p)/2); \\ Michel Marcus, Nov 19 2016
    
  • PARI
    v=List(); p=3; forprime(q=5,, if(isprime((q-p)/2), listput(v,p); if(#v==10^4, return)); p=q) \\ Charles R Greathouse IV, Nov 20 2016