OFFSET
1,1
COMMENTS
a(n) = prime(k) for the first k such that A072971(k) = n.
EXAMPLE
a(5) = 17 = prime(7) because the next prime after 17 with last digit 7 is 37 = prime(7+5).
MAPLE
N:= 30: # for a(1) to a(N)
f:= proc(n) local p, k, t;
p:= ithprime(n);
t:= p mod 10;
for k from 1 do
p:= nextprime(p);
if p mod 10 = t then return k fi
od
end proc:
V:= Vector(N): V[4]:= 3; count:= 1:
for n from 4 while count < N do
v:= f(n);
if v > 0 and v <= N and V[v] = 0 then
V[v]:= ithprime(n); count:= count+1;
fi
od:
convert(V, list);
CROSSREFS
KEYWORD
nonn,base
AUTHOR
J. M. Bergot and Robert Israel, Jan 21 2021
STATUS
approved