OFFSET
0,1
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.
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
FORMULA
Starting at 0, count primes between 0-5, 5-15, 15-25, etc.
EXAMPLE
Between n's 115 and 125 there are no primes, indicated by the entry 0.
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 *)
PROG
(PARI) a(n) = my(na = 10*n - 5); my(nb = na + 10); primepi(nb - 1) - primepi(na + 1); \\ Michel Marcus, Aug 25 2013
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
STATUS
approved