login
Smallest prime x > n such that x (mod n) = x (mod p[n]), where p[n] is n-th prime.
0

%I #8 Oct 05 2013 05:00:19

%S 2,7,17,29,59,79,239,157,211,293,347,449,541,607,709,853,1009,1103,

%T 1277,1423,1543,1741,1913,2137,2437,2633,2789,2999,3163,3391,3943,

%U 4201,4523,4729,5227,5437,5813,6197,6521,6947,7349,7603,8219,8501,8867,9157,9923

%N Smallest prime x > n such that x (mod n) = x (mod p[n]), where p[n] is n-th prime.

%e a(2)=7 because p[2]=3 and x=7 is smallest prime > 2 such that x (mod 2)=x (mod 3).

%o (PARI) a(n) = {p = nextprime(n+1); while ( (p % n) != (p % prime(n)), p = nextprime(p+1)); p;} \\ _Michel Marcus_, Oct 05 2013

%K nonn

%O 1,1

%A _Zak Seidov_, Feb 21 2004