The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A112341 Number of primes between (prime(n)-1)^2 and prime(n)^2. 2
2, 2, 3, 4, 5, 5, 7, 6, 7, 9, 8, 9, 12, 9, 10, 16, 13, 16, 15, 21, 15, 18, 19, 18, 21, 23, 20, 24, 23, 25, 29, 28, 23, 27, 33, 32, 27, 32, 33, 30, 29, 36, 34, 37, 37, 37, 38, 41, 45, 38, 39, 49, 47, 45, 53, 46, 53, 46, 45, 49, 53, 51, 48, 49, 55, 51, 62, 66, 61, 61, 60, 66, 63, 61 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Begin with the first prime, compute square root, take floor and add 1. If result is a prime number then begin the count for that prime value. Increment the count until prime value changes.
LINKS
FORMULA
a(n) = A000720(A000040(n)^2) - A000720((A000040(n)-1)^2). - Ray Chandler, Sep 06 2005
EXAMPLE
a(5) = 5 because for primes 101-103-107-109-113 the floor of the square root of each is 10. For each 10, 1 is added, so for prime 11 the count is 5.
MATHEMATICA
a[n_] := PrimePi[Prime[n]^2] - PrimePi[(Prime[n] - 1)^2]; Table[a[n], {n, 74}] (* Ray Chandler, Sep 06 2005 *)
PROG
(UBASIC) 10 A=1 20 B=nxtprm(B) 30 C=int(sqrt(B)) 40 D=C+1 50 if E=D then N=N+1:else print N:N=1:stop 60 if D=prmdiv(D) then print B; C; D; "-" 70 E=D 80 goto 20
(PARI) lista(pmax) = {my(c = 0); forprime(p = 2, pmax, c = 0; forprime(q = (p-1)^2, p^2, c++); print1(c, ", ")); } \\ Amiram Eldar, Apr 29 2024
CROSSREFS
Sequence in context: A344672 A360141 A354945 * A242774 A183003 A351007
KEYWORD
easy,nonn
AUTHOR
Enoch Haga, Sep 05 2005
EXTENSIONS
Edited by Ray Chandler, Sep 06 2005
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 20 06:19 EDT 2024. Contains 372703 sequences. (Running on oeis4.)