OFFSET
0,1
COMMENTS
This is really a duplicate of A068695. See that entry for existence proof. - N. J. A. Sloane, Nov 07 2020
Note that of course a(n) is not allowed to begin with 0.
Many numbers become prime by appending a one-digit odd number. Some numbers (such as 20, 32, 51, etc.) require a 2 digit odd number (A032352 has these). In the first 100,000 values of n there are only 22 that require a 3 digit odd number (A091089). There probably are some values that require odd numbers of 4 or more digits, but these are likely to be very large.
LINKS
EXAMPLE
a(0)=3 because 3 is the minimum odd number which when appended to 0 forms a prime (03 = 3 = prime).
a(20)=11 because 11 is the minimum odd number which when appended to 20 forms a prime (201, 203, 205, 207, 209 are all nonprime, 2011 is prime).
MATHEMATICA
Table[Block[{k = 1}, While[! PrimeQ@ FromDigits[IntegerDigits[n] ~Join~ IntegerDigits[k]], k += 2]; k], {n, 0, 101}] (* Michael De Vlieger, Nov 24 2017 *)
PROG
(PARI) a(n) = forstep(x=1, +oo, 2, if(isprime(eval(concat(Str(n), x))), return(x))) \\ Iain Fox, Nov 23 2017
CROSSREFS
KEYWORD
base,easy,nonn,less
AUTHOR
Chuck Seggelin (barkeep(AT)plastereddragon.com), Dec 18 2003
STATUS
approved