%I #17 Jan 05 2023 10:17:03
%S 2,23,307,7001,10007,700001,1000003,30000001,100000007,7000000001,
%T 10000000019,900000000013,3000000000013,30000000000011,
%U 100000000000031,1000000000000037,70000000000000003,300000000000000011
%N a(1) = 2. Then the smallest n-digit prime starting with the last digit of the previous term.
%C Before correction the sequence began as follows: 2, 23, 311, 1009, 90001, 100003, 3000017. However the third term is incorrect since the smallest 3-digit prime with most significant digit 3 is 307 not 311. - Alexis Olson (AlexisOlson(AT)gmail.com), Nov 14 2008
%H Robert Israel, <a href="/A077203/b077203.txt">Table of n, a(n) for n = 1..995</a>
%e a(5) = 90001 has (LSD) Least Significant Digit as 1 and a(6) = 100003, the smallest 6 digit prime with the most significant digit as 1.
%p A[1]:= 2:
%p for n from 2 to 30 do A[n]:= nextprime((A[n-1] mod 10)*10^(n-1)) od:
%p seq(A[i],i=1..30); # _Robert Israel_, Jan 04 2023
%t For[i = 1; v = 2; s = {}, i <= 500, i++, LSD = IntegerDigits[v][[-1]]; For[n = LSD*10^i, n <= 2*LSD*10\^i, n++, If[PrimeQ[n], v = n; s = Union[s, {n}]; Break[]]]]; s (* Alexis Olson, Nov 14 2008 *)
%t NestList[NextPrime[Mod[#,10]10^IntegerLength[#]]&,2,20] (* _Harvey P. Dale_, Apr 03 2011 *)
%K base,nonn
%O 1,1
%A _Amarnath Murthy_, Nov 02 2002
%E Corrected and extended by Alexis Olson (AlexisOlson(AT)gmail.com), Nov 14 2008