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!)
A188817 Number of primes between n-sqrt(n) and n+sqrt(n), inclusive. 7
1, 2, 2, 3, 3, 2, 2, 1, 2, 3, 2, 2, 2, 3, 2, 3, 3, 2, 3, 3, 3, 2, 2, 1, 2, 3, 3, 3, 2, 2, 2, 3, 3, 3, 2, 3, 4, 3, 3, 3, 4, 4, 4, 3, 3, 3, 4, 3, 3, 3, 2, 3, 3, 4, 3, 3, 3, 3, 3, 4, 3, 3, 3, 4, 5, 5, 5, 4, 4, 3, 4, 4, 4, 4, 5, 4, 4, 4, 4, 3, 4, 4, 3, 3, 3, 3, 3, 4, 3, 3, 3, 4, 3, 4, 4, 4, 4, 5, 4, 5, 5, 5, 6, 6, 6, 6, 6, 5, 5, 5, 5, 4, 4, 3, 3, 3, 4, 3, 3, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

It appears that all terms are positive.

LINKS

Robert Israel, Table of n, a(n) for n = 1..10000

EXAMPLE

a(1)=1 because prime 2 is in [0,2].

a(2)=2 because primes 2 and 3 are between 2-sqrt(2) and 2+sqrt(2).

a(3)=2 because primes 2 and 3 are between 3-sqrt(3) and 3+sqrt(3).

a(4)=3 because primes 2, 3, and 5 are in [2,6].

MAPLE

A188817 := proc(n) local low, hi; low := n-sqrt(n) ; if not issqr(n) then low := ceil(low) ; end if; hi := n+sqrt(n) ; if not issqr(n) then hi := floor(hi) ; end if; numtheory[pi](hi)-numtheory[pi](low-1) ; end proc:

seq(A188817(n), n=1..50) ; # R. J. Mathar, Apr 12 2011

MATHEMATICA

Join[{1, 2, 2, 3}, Table[PrimePi[n + Sqrt[n]] - PrimePi[n - Sqrt[n]], {n, 5, 120}]] (* T. D. Noe, Apr 11 2011 *)

CROSSREFS

Cf. A114021, A060715.

Sequence in context: A220517 A271076 A087175 * A271099 A165299 A071820

Adjacent sequences:  A188814 A188815 A188816 * A188818 A188819 A188820

KEYWORD

nonn,look

AUTHOR

Juri-Stepan Gerasimov, Apr 11 2011

EXTENSIONS

Corrected by T. D. Noe, Apr 11 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 7 01:26 EDT 2020. Contains 334836 sequences. (Running on oeis4.)