A216266 Number of primes between n^3 and n^3+n (inclusive).
1, 0, 1, 1, 1, 0, 2, 0, 1, 1, 0, 1, 2, 2, 1, 2, 1, 3, 3, 3, 2, 4, 0, 3, 5, 4, 4, 2, 3, 2, 2, 5, 3, 3, 2, 5, 2, 3, 4, 5, 2, 3, 3, 5, 8, 5, 4, 5, 4, 3, 6, 6, 4, 4, 6, 5, 3, 7, 8, 2, 3, 6, 6, 5, 4, 5, 6, 5, 4, 4, 3, 4, 8, 8, 4, 5, 8, 7, 6, 5, 4, 5, 9, 6, 8, 8, 6, 8, 10, 6, 9, 11
Offset: 1
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..10000
Programs
-
Java
import java.math.BigInteger; public class A216266 { public static void main (String[] args) { for (long n=1; n < (1<<21); n++) { long cube = n*n*n, c = 0; for (long k=cube+1; k<=cube+n; ++k) { BigInteger b1 = BigInteger.valueOf(k); if (b1.isProbablePrime(2)) { if (b1.isProbablePrime(80)) ++c; } } System.out.printf("%d, ", c); } } }
-
Maple
a:= n-> add(`if`(isprime(t), 1, 0), t=n^3..n^3+n): seq(a(n), n=1..100); # Alois P. Heinz, Mar 17 2013
-
Mathematica
Table[PrimePi[n^3+n]-PrimePi[n^3],{n,100}] (* Harvey P. Dale, Apr 19 2014 *)
-
PARI
default(primelimit,10^7); a(n) = primepi(n^3+n) - primepi(n^3); /* Joerg Arndt, Mar 16 2013 */
Comments