OFFSET
1,1
COMMENTS
a(n) exists by Dirichlet's theorem on primes in arithmetic progressions.
LINKS
EXAMPLE
For n=3 the third number ending in 1,3,7 or 9 is 7 and the least prime > 7 ending in 7 is a(3)=17.
For n=12 the 12th number ending in 1,3,7 or 9 is 29 and the least prime > 29 ending in 29 is a(12)=229.
MAPLE
f:= proc(n) local d, x;
d:= ilog10(n)+1;
for x from n + 10^d by 10^d do
if isprime(x) then return x fi
od
end proc:
map(f, [seq(seq(10*i+j, j=[1, 3, 7, 9]), i=0..99)];
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel, Sep 24 2020
STATUS
approved