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

A340553
a(n) = card({k: prime(n) mod k is not prime}).
0
2, 3, 4, 5, 6, 9, 9, 12, 10, 16, 19, 22, 23, 24, 21, 29, 30, 38, 38, 39, 45, 47, 44, 53, 59, 57, 60, 57, 72, 67, 77, 74, 79, 86, 90, 94, 95, 97, 93, 100, 107, 119, 116, 125, 121, 130, 135, 135, 128, 150, 143, 147, 160, 156, 159, 160, 169, 174, 175, 185, 175
OFFSET
1,1
EXAMPLE
a(9) = 10 because prime(9) = 23 and 23 mod k is only not prime for k in {1, 2, 11, 13, 14, 15, 17, 19, 22, 23}.
a(10) = 16 because prime(10) = 27 and 27 mod k is only not prime for k in {1, 2, 4, 5, 7, 10, 14, 15, 17, 19, 20, 21, 23, 25, 28, 29}.
PROG
(PARI) a(n) = my(p=prime(n)); sum(k=1, p, !isprime(p % k)); \\ Michel Marcus, Jan 21 2021
CROSSREFS
Sequence in context: A075164 A240827 A023841 * A245605 A269863 A297165
KEYWORD
nonn
AUTHOR
Peter Luschny, Jan 21 2021
STATUS
approved