OFFSET
1,10
COMMENTS
Conjecture: a(n) > 0 for n > 13.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
EXAMPLE
a(9) = 1 because between 9^3 - 9 and 9^3 there is just one prime (727).
a(10) = 2 because between 10^3 - 10 and 10^3 there are two primes (991 and 997).
a(11) = 2 because between 11^3 - 11 and 11^3 there are two primes (1321 and 1327).
MAPLE
a:= n-> add(`if`(isprime(t), 1, 0), t=n^3-n..n^3):
seq(a(n), n=1..100); # Alois P. Heinz, Mar 17 2013
MATHEMATICA
Table[PrimePi[n^3] - PrimePi[n^3 - n], {n, 100}] (* Alonso del Arte, Mar 17 2013 *)
PROG
(Java)
import java.math.BigInteger;
public class A216265 {
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 - n; k < cube; ++k) {
BigInteger b1 = BigInteger.valueOf(k);
if (b1.isProbablePrime(2)) {
if (b1.isProbablePrime(80))
++c;
}
}
System.out.printf("%d, ", c);
}
}
} // Ratushnyak
(PARI)
default(primelimit, 10^7);
a(n) = primepi(n^3) - primepi(n^3-n);
/* Joerg Arndt, Mar 16 2013 */
CROSSREFS
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, Mar 15 2013
STATUS
approved