login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(n) is the number of different primes that can be expressed as n mod p where p < n is prime.
2

%I #12 Feb 02 2021 12:36:36

%S 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,

%T 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,

%U 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

%N a(n) is the number of different primes that can be expressed as n mod p where p < n is prime.

%C a(n) is the number of primes p < n such that n-p has a prime factor > p.

%C a(n) <= A056172(n-1), with equality for n = 1, 2, 3, 4, 5, 8, 24.

%H Robert Israel, <a href="/A340996/b340996.txt">Table of n, a(n) for n = 1..10000</a>

%e a(8) = 2 because 2 = 8 mod 3 and 3 = 8 mod 5.

%p f:= proc(n) local k; nops(select(isprime,{seq(n mod k, k=select(isprime,[$2..n-1]))})) end proc:

%p map(f, [$1..100]);

%Y Cf. A056172, A340997.

%K nonn,look

%O 1,8

%A _J. M. Bergot_ and _Robert Israel_, Feb 01 2021