OFFSET
1,1
COMMENTS
Declare a current total to 0 and a current composite to 4 and a current index n to 1. For each prime p, compute c:=floor(sqrt(p)) + 1. If c is composite then see if c is equal to the current composite. If it is, add 1 to the current total. Else a(n) = current total and set the current total to 1. If enough terms of the sequence have been found, store the found terms and end the algorithm. - David A. Corneth, Jun 03 2024
LINKS
David A. Corneth, Table of n, a(n) for n = 1..10000
David A. Corneth, PARI program
FORMULA
EXAMPLE
a(1)=2 because for primes 11 and 13, the floor of the square root of both primes is 3. Since 1 is added to each, 3+1=4, for the composite 4 the count is 2.
MATHEMATICA
Table[PrimePi[ResourceFunction["Composite"][n]^2]-PrimePi[(ResourceFunction["Composite"][n]-1)^2], {n, 77}] (* James C. McMahon, Jun 02 2024 *)
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) \\ See Corneth link
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Enoch Haga, Sep 05 2005
EXTENSIONS
Edited by Ray Chandler, Sep 06 2005
STATUS
approved