

A266715


Number of k <= floor(n/2) such that (n mod k) is prime.


3



0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 2, 1, 1, 3, 2, 1, 4, 3, 3, 3, 3, 3, 8, 2, 3, 6, 7, 2, 7, 4, 6, 6, 7, 4, 10, 2, 8, 9, 9, 3, 10, 6, 11, 6, 10, 4, 17, 4, 7, 10, 12, 6, 15, 5, 13, 7, 13, 9, 19, 3, 13, 12, 17, 3, 17, 7, 18, 11, 13, 7, 21, 7, 17, 12, 20, 4, 23, 6
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,11


LINKS

Clark Kimberling, Table of n, a(n) for n = 1..1000


EXAMPLE

(11 mod k) gives 0,1,2,3,1, with primes 2,3, so a(11) = 2.


MATHEMATICA

t[n_] := Table[Mod[n, k], {k, 1, Floor[n/2]}]
p[n_] := Select[t[n], PrimeQ[#] &]
Table[Length[p[n]], {n, 1, 200}]


PROG

(PARI) a(n) = sum(k=1, n\2, isprime(n % k)); \\ Michel Marcus, Feb 04 2016


CROSSREFS

Cf. A266714, A268372.
Sequence in context: A124832 A226130 A137569 * A089177 A023996 A049998
Adjacent sequences: A266712 A266713 A266714 * A266716 A266717 A266718


KEYWORD

nonn,easy


AUTHOR

Clark Kimberling, Feb 03 2016


STATUS

approved



