|
|
A089778
|
|
a(n) is the n-th prime that ends with prime(n), or 0 if there do not exist n primes ending with prime(n).
|
|
2
|
|
|
2, 13, 0, 47, 911, 1213, 2417, 1619, 1723, 2729, 2131, 3137, 4241, 4643, 3947, 4153, 4759, 5861, 4967, 6271, 6173, 6379, 6883, 7589, 7297, 98101, 97103, 104107, 108109, 129113, 130127, 122131, 174137, 136139, 131149, 150151, 172157, 147163
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
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:
|
|
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
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|