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.

A059316 Least integer m such that between m and 2m (including endpoints) there are exactly n primes.

Original entry on oeis.org

1, 2, 7, 10, 16, 22, 27, 31, 36, 37, 51, 52, 55, 57, 70, 79, 87, 91, 96, 97, 100, 120, 121, 126, 135, 136, 142, 147, 157, 175, 177, 187, 190, 205, 210, 211, 217, 220, 222, 232, 246, 250, 255, 262, 289, 297, 300, 301, 304, 307, 310, 324, 327, 330, 331, 342, 346
Offset: 1

Views

Author

Felice Russo, Jan 25 2001

Keywords

Comments

See A060756 for the case they are excluded. - R. J. Mathar, Nov 28 2007
A035250(a(n)) = n and A035250(m) <> n for m < a(n). - Reinhard Zumkeller, Jan 08 2012

Examples

			a(3)=7 because 7 is the least integer such that between 7 and 14 there are 3 primes.
		

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndex)
    import Data.Maybe (mapMaybe)
    a059316 n = a059316_list !! n
    a059316_list = map (+ 1) $ mapMaybe (`elemIndex` a035250_list) [1..]
    -- Reinhard Zumkeller, Jan 05 2012
  • Mathematica
    im[n_]:=Module[{m=1},While[PrimePi[2m]-(PrimePi[m-1])!=n,m++];m]; Array[  im,60]  (* Harvey P. Dale, May 19 2012 *)