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.

A247509 Number of preprimes (A156759, n>1) such that the smallest prime divisor equals prime(n).

Original entry on oeis.org

3, 3, 2, 4, 2, 3, 2, 2, 3, 2, 4, 3, 2, 2, 3, 3, 2, 4, 3, 2, 3, 2, 2, 4, 3, 2, 3, 2, 2, 5, 2, 3, 2, 4, 2, 3, 3, 2, 3, 3, 2, 5, 2, 3, 2, 3, 5, 3, 2, 2, 3, 2, 3, 3, 3, 3, 2, 4, 3, 2, 2, 5, 3, 2, 2, 3, 2, 4, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 2, 3, 2, 4, 2, 3, 2, 2, 4
Offset: 1

Views

Author

Vladimir Shevelev, Sep 18 2014

Keywords

Examples

			For n=2, using the formula, we have a(2)=pi(25/3)-1=3.
		

Crossrefs

Programs

  • Mathematica
    a[1] = 3;a[n_] := PrimePi[Prime[n + 1]^2 / Prime[n]] - n + 1; Table[a[n], {n, 1, 87}] (* Indranil Ghosh, Mar 09 2017 *)
  • PARI
    for (n=1, 87, print1(if(n==1, 3, primepi(prime(n + 1)^2 / prime(n)) - n + 1),", ")) \\ Indranil Ghosh, Mar 09 2017

Formula

For n>1, a(n) = pi(prime(n+1)^2/prime(n))-n +1, where pi(x) is the prime counting function (cf. A000720). - Vladimir Shevelev, Sep 28 2014

Extensions

More terms from Peter J. C. Moses, Sep 18 2014