login

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”).

A268372
Number of distinct primes (n mod k) for k=1..floor(n/2).
3
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, 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, 7, 4, 9, 3, 8, 4, 8, 4, 9, 2, 9, 5, 8, 5, 9, 3, 8, 4
OFFSET
1,11
LINKS
EXAMPLE
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.
MATHEMATICA
t[n_] := Table[Mod[n, k], {k, 1, Floor[n/2]}]
p[n_] := DeleteDuplicates[Select[t[n], PrimeQ[#] &]]
Table[Length[p[n]], {n, 1, 200}]
PROG
(PARI) a(n) = #vecsort(select(x->isprime(x), vector(n\2, k, n % k)), , 8); \\ Michel Marcus, Feb 04 2016
CROSSREFS
Sequence in context: A352635 A325937 A327167 * A361754 A298848 A193518
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Feb 03 2016
STATUS
approved