%I #8 Jun 08 2013 03:46:29
%S 2,2,3,4,3,4,5,4,6,5,6,7,7,6,9,8,7,8,8,10,9,10,9,10,9,12,11,11,12,11,
%T 13,13,15,10,11,15,12,13,11,12,17,16,13,17,15,14,16,15,17,13,15,17,17,
%U 18,22,14,23,13,20,20,17,16,21,22,18,20,20,19,23,21,21,22,23,21,22,21,21
%N Number of primes between (n-th composite - 1)^2 and (n-th composite)^2.
%F a(n) = A000720(A002808(n)^2) - A000720((A002808(n)-1)^2). - Chandler
%F Begin with the first prime, compute square root, take floor and add 1. If result is a composite number then begin the count for that composite value. Increment the count until the composite value changes.
%e 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.
%o (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
%Y Cf. A112341.
%K easy,nonn
%O 1,1
%A _Enoch Haga_, Sep 05 2005
%E Edited by _Ray Chandler_, Sep 06 2005
|