cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A216265 Number of primes between n^3 - n and n^3.

Original entry on oeis.org

0, 1, 0, 1, 0, 1, 1, 1, 1, 2, 2, 2, 0, 2, 3, 2, 2, 2, 2, 1, 2, 3, 4, 1, 3, 3, 2, 3, 3, 3, 2, 1, 3, 2, 4, 4, 3, 2, 1, 2, 7, 4, 2, 2, 4, 3, 4, 7, 3, 5, 7, 4, 6, 5, 4, 2, 8, 4, 3, 4, 2, 5, 7, 7, 4, 3, 8, 4, 1, 3, 2, 10, 4, 5, 4, 6, 7, 8, 6, 6, 1, 6, 8, 8, 7, 7, 6, 7, 4, 10
Offset: 1

Views

Author

Alex Ratushnyak, Mar 15 2013

Keywords

Comments

Conjecture: a(n) > 0 for n > 13.

Examples

			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).
		

Crossrefs

Programs

  • 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
    
  • 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 *)
  • PARI
    default(primelimit,10^7);
    a(n) = primepi(n^3) - primepi(n^3-n);
    /* Joerg Arndt, Mar 16 2013 */

Formula

a(n) = A000720(n^3) - A000720(n^3-n).