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.

A241536 Smallest k>=1 such that prime(n)+k and prime(n)-k are both semiprimes, or a(n)=0 if there is no such k.

Original entry on oeis.org

0, 0, 1, 3, 0, 9, 8, 15, 2, 4, 27, 2, 8, 8, 8, 2, 10, 4, 2, 6, 4, 14, 28, 2, 32, 10, 8, 12, 14, 2, 6, 2, 4, 6, 6, 8, 2, 20, 34, 4, 24, 4, 14, 8, 12, 14, 2, 14, 8, 8, 14, 20, 6, 2, 8, 4, 20, 18, 10, 14, 16, 2, 2, 8, 8, 12, 4, 2, 8, 22, 12, 18, 26, 8, 2, 12, 18
Offset: 1

Views

Author

Vladimir Shevelev, Apr 25 2014

Keywords

Comments

If a(n)=2, then prime(n)+2 and prime(n)-2 are both semiprimes; that is, prime(n) belongs to A063643. - Michel Marcus, Mar 26 2015

Crossrefs

Programs

  • Mathematica
    sks[n_]:=Module[{k=1,p=Prime[n]},While[PrimeOmega[p+k]!=2||PrimeOmega[p-k]!=2||p-k<4,If[p-k<3,Break[]];k++];If[p-k<4,0,k]]; Array[sks,80] (* Harvey P. Dale, Dec 09 2016 *)
  • PARI
    a(n) = {p = prime(n); for (k=1, p-1, if ((bigomega(p-k)==2) && (bigomega(p+k) == 2), return (k));); return (0);} \\ Michel Marcus, Apr 25 2014

Extensions

More terms from Michel Marcus, Apr 25 2014
Name edited by Michel Marcus, Mar 26 2015