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.

A377937 Number of primes in the interval [n - A000005(n), n + A000005(n)].

Original entry on oeis.org

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

Views

Author

Ctibor O. Zizka, Nov 11 2024

Keywords

Examples

			n = 1, there is one prime in [0, 2], thus a(1) = 1.
n = 6, there are four primes in [2, 10], thus a(6) = 4.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{d = DivisorSigma[0, n]}, PrimePi[n + d] - PrimePi[n - d - 1]]; Array[a, 100] (* Amiram Eldar, Nov 11 2024 *)

Formula

a(n) = pi(n+tau(n)) - pi(n-tau(n)-1).