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.

Showing 1-2 of 2 results.

A216266 Number of primes between n^3 and n^3+n (inclusive).

Original entry on oeis.org

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

Views

Author

Alex Ratushnyak, Mar 15 2013

Keywords

Comments

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

Crossrefs

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 */

Formula

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

A217721 Number of primes between n^2 - log_2(n)^2 and n^2 (inclusive).

Original entry on oeis.org

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

Views

Author

Alex Ratushnyak, Mar 21 2013

Keywords

Comments

Conjecture: a(n) > 0 for n > 1.
Conjecture checked up to n = 2^28 - 1.

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Range[n^2, n^2 - Log[2, n]^2, -1], PrimeQ]], {n, 100}] (* T. D. Noe, Mar 21 2013 *)
  • Python
    import math
    def isprime(k):
      s = 3
      while s*s <= k:
        if k%s==0:  return 0
        s+=2
      return 1
    for n in range(1, 333):
      c = 0
      top = n*n
      for i in range(top - int(math.log(n, 2)**2), top):
        if i&1:  c += isprime(i)
      print(str(c), end=', ')
Showing 1-2 of 2 results.