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.

A048198 Number of primes between successive n's, where n mod 10 = 5.

Original entry on oeis.org

2, 3, 3, 2, 3, 2, 2, 3, 2, 1, 3, 3, 0, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 3, 2, 1, 2, 2, 3, 1, 0, 3, 1, 1, 1, 3, 1, 2, 2, 1, 2, 1, 2, 2, 2, 1, 3, 1, 1, 2, 2, 1, 2, 0, 1, 1, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2, 2, 1, 2, 1, 1, 1, 1, 2, 2, 1, 2, 2, 0, 1, 1, 2, 2, 2, 1, 1, 3, 0, 3, 1, 0, 2, 1, 1, 2, 2, 0, 2, 2, 1, 1, 2, 2, 2, 1
Offset: 0

Views

Author

Keywords

Comments

A way to visualize the distribution of primes without the clutter of the numbers themselves. Consecutive 0's indicate stretches where there are no primes. Other patterns become obvious, as a string of 2's or 1's.

Examples

			Between n's 115 and 125 there are no primes, indicated by the entry 0.
		

Crossrefs

Cf. A048199.

Programs

  • Maple
    f:= n -> nops(select(isprime, [$10*n-4..10*n+4])):
    map(f, [$0..100]); # Robert Israel, Nov 22 2018
  • Mathematica
    a[n_] := Length[Select[Range[Max[10 n - 4, 1], 10 n + 4], PrimeQ]]; Array[a, 100, 0] (* Amiram Eldar, Nov 22 2018 *)
    Join[{2},Differences[PrimePi[Range[5,1115,10]]]] (* Harvey P. Dale, Jul 20 2023 *)
  • PARI
    a(n) = my(na = 10*n - 5); my(nb = na + 10); primepi(nb - 1) - primepi(na + 1); \\ Michel Marcus, Aug 25 2013

Formula

Starting at 0, count primes between 0-5, 5-15, 15-25, etc.