login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A189025 Number of primes in the range (n - 2*sqrt(n), n]. 7
0, 1, 2, 2, 3, 3, 4, 3, 2, 2, 3, 2, 3, 3, 2, 2, 3, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 2, 3, 3, 3, 3, 2, 2, 3, 3, 3, 3, 4, 3, 4, 4, 3, 3, 4, 4, 4, 4, 4, 3, 4, 4, 4, 3, 3, 3, 3, 3, 4, 4, 3, 3, 3, 3, 4, 4, 4, 3, 4, 4, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 5, 5, 5, 4, 4, 4, 5, 4, 4, 4, 3, 3, 3, 3, 4, 4, 3, 3, 4, 4, 5, 4, 4, 4, 5, 5, 6, 5, 5, 5, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 4, 4, 3, 4 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

COMMENTS

Note that the lower bound, n-2*sqrt(n), is excluded from the count and the upper range, n, is included. The only zero term appears to be a(1). See A189027 for special primes associated with this sequence. This sequence is related to Legendre's conjecture that there is a prime between consecutive squares.

LINKS

T. D. Noe, Table of n, a(n) for n = 1..10000

Wikipedia, Legendre's conjecture

MATHEMATICA

cnt = 0; lastLower = -3; Table[lower = Floor[n - 2*Sqrt[n]]; If[lastLower < lower && PrimeQ[lower], cnt--]; lastLower = lower; If[PrimeQ[n], cnt++]; cnt, {n, 100}]

PROG

(PARI) a(n)=if(n<default(primelimit), primepi(n)-primepi(n-2*sqrtint(n)), sum(k=n-2*sqrtint(n)+1, n, isprime(k))) \\ Charles R Greathouse IV, May 11 2011

CROSSREFS

Cf. A188817, A189024, A189026.

Sequence in context: A031268 A237817 A306949 * A236347 A045430 A067693

Adjacent sequences:  A189022 A189023 A189024 * A189026 A189027 A189028

KEYWORD

nonn,easy

AUTHOR

T. D. Noe, Apr 15 2011

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 2 11:35 EDT 2020. Contains 334771 sequences. (Running on oeis4.)