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.

A241533 Smallest prime p such that 2*prime(n) - p^2 is semiprime, or a(n)=0 if there is no such p.

Original entry on oeis.org

0, 0, 2, 2, 0, 2, 3, 2, 5, 3, 2, 3, 5, 2, 3, 7, 5, 2, 7, 3, 2, 5, 5, 3, 3, 5, 2, 3, 2, 3, 7, 3, 3, 2, 3, 2, 3, 5, 5, 5, 7, 2, 13, 2, 19, 2, 3, 3, 3, 2, 7, 3, 2, 3, 3, 3, 3, 2, 3, 3, 2, 7, 5, 5, 2, 0, 13, 5, 3, 2, 3, 7, 7, 3, 3, 7, 5, 3, 3, 5, 5, 2, 7, 2, 3, 13
Offset: 1

Views

Author

Vladimir Shevelev, Apr 25 2014

Keywords

Examples

			Let n=16, then 2*prime(16) = 2*53 = 106. We have 106-4=102, 106-9=97, 106-25=81, 106-49=57, and only the last number is semiprime. So a(16)=7.
		

Crossrefs

Programs

  • PARI
    a(n) = {for (i=1, n, if ((v = 2*prime(n) - prime(i)^2) <= 0, break;); if (bigomega(v) == 2, return (prime(i))););} \\ Michel Marcus, May 09 2014