A340996 a(n) is the number of different primes that can be expressed as n mod p where p < n is prime.
0, 0, 0, 0, 1, 0, 1, 2, 1, 1, 1, 2, 2, 2, 1, 3, 2, 3, 2, 3, 1, 3, 2, 5, 2, 4, 2, 4, 3, 4, 3, 3, 4, 3, 1, 6, 3, 4, 2, 6, 3, 6, 3, 5, 4, 5, 4, 7, 4, 6, 4, 5, 3, 8, 3, 5, 3, 6, 4, 9, 3, 6, 5, 8, 4, 7, 2, 6, 4, 8, 4, 9, 5, 7, 5, 8, 3, 9, 5, 7, 7, 7, 4, 10, 5, 6, 5, 7, 6, 12, 5, 7, 7, 7, 4, 11, 5, 9
Offset: 1
Examples
a(8) = 2 because 2 = 8 mod 3 and 3 = 8 mod 5.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
f:= proc(n) local k; nops(select(isprime,{seq(n mod k, k=select(isprime,[$2..n-1]))})) end proc: map(f, [$1..100]);
Comments