OFFSET
1,7
LINKS
Clark Kimberling, Table of n, a(n) for n = 1..1000
EXAMPLE
(11 mod k) gives 0,1,2,3,1,5,4,3,2,1,0, with primes 2,3,5,3,2, so a(11) = 5.
MATHEMATICA
t[n_] := Table[Mod[n, k], {k, 1, n}]
p[n_] := Select[t[n], PrimeQ[#] &]
Table[Length[p[n]], {n, 1, 200}]
PROG
(PARI) a(n) = sum(k=2, n, isprime(n % k)); \\ Michel Marcus, Feb 04 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Feb 03 2016
STATUS
approved