OFFSET
1,1
COMMENTS
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Legendre's Conjecture.
FORMULA
a(n) = 2*A000006(n) + 1.
a(n) = 2*floor(sqrt(prime(n))) + 1. - R. J. Mathar, Apr 21 2006
EXAMPLE
The 7th prime number is 17, which is between the consecutive squares 16 and 25, so a(7) = 25 - 16 = 9.
MATHEMATICA
a[n_]:=2Floor[Sqrt[Prime[n]]]+1
PROG
(PARI) { forprime(p=2, 200, f = floor(sqrt(p)) ; print1(2*f+1, ", ") ; ) ; } \\ R. J. Mathar, Apr 21 2006
(Haskell)
a117767 = (+ 1) . (* 2) . a000006 -- Reinhard Zumkeller, Sep 20 2014
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Odimar Fabeny, Apr 15 2006
EXTENSIONS
More terms from R. J. Mathar, Apr 21 2006
Edited by Dean Hickerson, Jun 03 2006
STATUS
approved