A105436 Smallest prime that remains prime when a string of n 1's is appended to it.
2, 3, 2, 2, 13, 3, 29, 7, 17, 17, 3, 3, 2, 3, 197, 5, 13, 173, 2, 13, 53, 73, 199, 2, 23, 73, 599, 239, 547, 59, 409, 1009, 1277, 19, 3, 383, 137, 13, 653, 103, 139, 227, 19, 127, 359, 193, 1123, 3, 97, 1447, 839, 109, 3, 47, 17, 7, 269, 2, 1657, 1973, 709, 5233, 809
Offset: 0
Examples
a(2)=2 because it is the first prime followed by 3,41,101,107,113,137,... all remaining primes when 11 is appended to each of them.
Programs
-
Maple
with(numtheory); for n from 1 to 100 do for i from 1 to 5000 do if isprime(ithprime(i)*10^n + sum(10^j, j=0..n-1)) then printf(`%d,`, ithprime(i)); break; fi: od:od: # James Sellers, Apr 09 2005
-
Mathematica
f[n_] := Block[{k = 1, t = Table[1, {n}]}, While[id = IntegerDigits[ Prime[k]]; id[[ -1]] == 1 || !PrimeQ[ FromDigits[ Join[id, t]]], k++ ]; Prime[k]]; Table[ f[n], {n, 0, 62}] (* Robert G. Wilson v, Apr 09 2005 *)
Extensions
More terms from Robert G. Wilson v and James Sellers, Apr 09 2005