OFFSET
1,2
COMMENTS
The first number ending in prime(n) is, of course, prime(n). The numbers 2 and 5 are zero because there are no additional primes ending in those numbers; they are the numbers divisible by 2 or 5.
LINKS
T. D. Noe, Table of n, a(n) for n = 1..200
EXAMPLE
23 is the third prime ending with 3.
107 is the seventh prime ending in 7.
2411 is the 11th prime ending in 11.
3413 is the 13th prime ending in 13 -- a very unlucky prime.
MATHEMATICA
ps = Prime[Range[PrimePi[1000000]]]; t = {}; p = 1; done = False; While[! done, p = NextPrime[p]; len = Length[IntegerDigits[p]]; s = Select[ps, Mod[#, 10^len] == p &, p]; If[Length[s] < p, If[MemberQ[{2, 5}, p], AppendTo[t, 0], done = True], AppendTo[t, s[[-1]]]]]; t
CROSSREFS
KEYWORD
nonn,base
AUTHOR
T. D. Noe, Feb 27 2014
STATUS
approved