Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #8 Feb 11 2016 08:09:20
%S 0,0,0,0,0,0,0,1,0,1,2,1,1,1,1,1,3,2,2,1,2,1,4,2,3,2,4,2,4,2,3,2,3,2,
%T 5,2,5,3,4,3,6,2,5,2,5,2,6,2,5,3,6,3,7,3,6,3,7,4,8,3,7,4,7,3,8,2,8,4,
%U 7,4,9,3,8,4,8,4,9,2,9,5,8,5,9,3,8,4
%N Number of distinct primes (n mod k) for k=1..floor(n/2).
%H Clark Kimberling, <a href="/A268372/b268372.txt">Table of n, a(n) for n = 1..1000</a>
%e For k=1..15, the numbers (31 mod k) are 0, 1, 1, 3, 1, 1, 3, 7, 4, 1, 9, 7, 5, 3, 1; the primes are 3,3,7,7,5,3, so that a(31) = 3.
%t t[n_] := Table[Mod[n, k], {k, 1, Floor[n/2]}]
%t p[n_] := DeleteDuplicates[Select[t[n], PrimeQ[#] &]]
%t Table[Length[p[n]], {n, 1, 200}]
%o (PARI) a(n) = #vecsort(select(x->isprime(x), vector(n\2, k, n % k)),,8); \\ _Michel Marcus_, Feb 04 2016
%Y Cf. A266714, A266715.
%K nonn,easy
%O 1,11
%A _Clark Kimberling_, Feb 03 2016