OFFSET
1,1
COMMENTS
a(n) is the smallest among (1.p ; 2.p ; p.0) where p=prime(n) and . denotes concatenation: one among 1.p and 2.p is divisible by 3, but of course p.0 = 10p is also composite and may be smaller than the other two. None of the three can occur earlier because any of the three yields the n-th prime when the first digit (or the last, in case it is zero) is removed: This yields a bijection from the range of this sequence to the set of primes.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
E. Angelini, Hide my prime (in a composite), Nov 21 2014
PROG
(PARI) a(n)=forstep(t=n=prime(n), 10*n, 10^#Str(n), !isprime(t)&&return(t)); 10*n
(Python)
from sympy import isprime, prime
def a(n):
k, target = 4, str(prime(n))
while not target in str(k) or isprime(k): k += 1
return k
print([a(n) for n in range(1, 51)]) # Michael S. Branicky, Dec 30 2021
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Eric Angelini and M. F. Hasler, Nov 21 2014
STATUS
approved