OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(5) = 911 because prime(5) = 11 and the first 5 primes ending with 11 are 11, 211, 311, 811 and 911.
a(3) = 0 because prime(3) = 5 and only 1 prime ends with 5.
MAPLE
f:= proc(n) local p, d, k, count;
p:= ithprime(n);
d:= 10^(ilog10(p)+1);
count:= 1;
for k from 1 while count < n do
if isprime(k*d+p) then count:= count+1 fi
od;
(k-1)*d+p
end proc:
f(3):= 0:
map(f, [$1..100]); # Robert Israel, Dec 10 2017
PROG
(PARI) a(n) = if(n == 3, return(0)); my(p = prime(n), d = 10^(logint(p, 10)+1), i = 1); for(x=0, +oo, if(isprime(x*d+p), i++; if(i > n, return(x*d+p)))); \\ Iain Fox, Dec 10 2017
CROSSREFS
KEYWORD
base,nonn,easy
AUTHOR
Amarnath Murthy, Nov 24 2003
EXTENSIONS
Corrected and extended by David Wasserman, Oct 12 2005
STATUS
approved