[go: up one dir, main page]

login
A256469
Number of primes between prime(n)*prime(n+1) and prime(n+1)^2.
5
1, 3, 4, 9, 5, 14, 6, 15, 25, 8, 30, 23, 9, 23, 42, 42, 16, 47, 35, 15, 54, 39, 62, 88, 44, 20, 45, 23, 52, 194, 52, 84, 27, 158, 32, 92, 97, 63, 96, 99, 36, 176, 37, 71, 37, 236, 252, 83, 38, 81, 141, 47, 222, 142, 134, 155, 46, 145, 94, 53, 252, 381, 105, 55, 107, 398, 176, 296, 61
OFFSET
1,2
LINKS
FORMULA
a(n) = A256448(n)+2.
a(n) = A050216(n) - A256468(n).
a(n) = A256468(n) + A256470(n).
EXAMPLE
For n=1, there is only one prime in range prime(1)*prime(2) .. prime(2)^2, [6 .. 9], namely 7, thus a(1) = 1.
For n=2, the primes in range prime(2)*prime(3) .. prime(3)^2, [15 .. 25] are {17, 19, 23}, thus a(2) = 3.
MATHEMATICA
Table[Count[Range[Prime[n] Prime[n + 1], Prime[n + 1]^2], _?PrimeQ], {n, 69}] (* Michael De Vlieger, Mar 30 2015 *)
Table[PrimePi[Prime[n+1]^2]-PrimePi[Prime[n]Prime[n+1]], {n, 70}] (* Harvey P. Dale, Jul 31 2021 *)
PROG
(PARI)
allocatemem(234567890);
default(primelimit, 4294965247);
A256469(n) = (primepi(prime(n+1)^2) - primepi(prime(n)*prime(n+1)));
for(n=1, 6541, write("b256469.txt", n, " ", A256469(n)));
(Scheme) (define (A256469 n) (let* ((p (A000040 n)) (q (A000040 (+ 1 n))) (q2 (* q q))) (let loop ((s 0) (k (* p q))) (cond ((= k q2) s) (else (loop (+ s (if (prime? k) 1 0)) (+ k 1)))))))
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Mar 30 2015
STATUS
approved