|
| |
|
|
A112341
|
|
Number of primes between (prime(n)-1)^2 and prime(n)^2.
|
|
1
| |
|
|
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; internal format)
|
|
|
|
OFFSET
| 1,1
|
|
|
FORMULA
| a(n) = A000720(A000040(n)^2) - A000720((A000040(n)-1)^2). - Chandler
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.
|
|
|
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
| f[n_] := PrimePi[Prime[n]^2] - PrimePi[(Prime[n] - 1)^2]; Table[f[n], {n, 74}] (*Chandler*)
|
|
|
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
|
|
|
CROSSREFS
| Cf. A112342.
Sequence in context: A089646 A011884 A029070 * A183003 A165684 A015743
Adjacent sequences: A112338 A112339 A112340 * A112342 A112343 A112344
|
|
|
KEYWORD
| easy,nonn
|
|
|
AUTHOR
| Enoch Haga (Enokh(AT)comcast.net), Sep 05 2005
|
|
|
EXTENSIONS
| Edited by Ray Chandler (rayjchandler(AT)sbcglobal.net), Sep 06 2005
|
| |
|
|