login
A091313
Smallest prime x > n such that x (mod n) = x (mod prime(n)).
1
2, 7, 17, 29, 59, 79, 239, 157, 211, 293, 347, 449, 541, 607, 709, 853, 1009, 1103, 1277, 1423, 1543, 1741, 1913, 2137, 2437, 2633, 2789, 2999, 3163, 3391, 3943, 4201, 4523, 4729, 5227, 5437, 5813, 6197, 6521, 6947, 7349, 7603, 8219, 8501, 8867, 9157, 9923
OFFSET
1,1
COMMENTS
a(n) always exists, e.g. by Dirchlet's theorem on primes in arithmetic progressions there are infinitely many primes == 1 (mod n * prime(n)). - Robert Israel, Jun 05 2025
LINKS
EXAMPLE
a(2) = 7 because prime(2) = 3 and x = 7 is smallest prime > 2 such that x (mod 2) = x (mod 3).
MAPLE
f:= proc(n) local b, u, k, x;
b:= ithprime(n);
for u from 1 do
for k from 1 to n-1 do
x:= k + u*n*b;
if isprime(x) then return x fi
od od
end proc:
f(1):= 2:
map(f, [$1..100]); # Robert Israel, Jun 05 2025
PROG
(PARI) a(n) = {p = nextprime(n+1); while ( (p % n) != (p % prime(n)), p = nextprime(p+1)); p; } \\ Michel Marcus, Oct 05 2013
CROSSREFS
Cf. A000040.
Sequence in context: A031377 A019357 A024920 * A049554 A019398 A086513
KEYWORD
nonn
AUTHOR
Zak Seidov, Feb 21 2004
STATUS
approved