login
a(1) = 9; a(2n) = smallest prime starting (most significant digits) with a(2n-1). a(2n+1) = smallest prime ending (least significant digits)in a(2n).
9

%I #6 Nov 11 2020 22:50:13

%S 9,97,197,1973,31973,319733,3319733,331973303,5331973303,533197330313,

%T 9533197330313,953319733031321,3953319733031321,395331973303132171,

%U 12395331973303132171,1239533197330313217121,391239533197330313217121

%N a(1) = 9; a(2n) = smallest prime starting (most significant digits) with a(2n-1). a(2n+1) = smallest prime ending (least significant digits)in a(2n).

%H Robert Israel, <a href="/A069636/b069636.txt">Table of n, a(n) for n = 1..348</a>

%p A[1]:= 9:

%p for n from 2 to 30 do

%p if n::even then

%p for d from 1 do

%p x:= nextprime(A[n-1]*10^d);

%p if x < (A[n-1]+1)*10^d then A[n]:= x; break fi

%p od

%p else

%p d:=ilog10(A[n-1])+1;

%p for x from A[n-1]+10^d by 10^d do

%p if isprime(x) then A[n]:= x; break fi

%p od

%p fi

%p od:

%p seq(A[i],i=1..30); # _Robert Israel_, Nov 11 2020

%Y Cf. A069614 to A069621, A069628 to A069636.

%K nonn,base

%O 1,1

%A _Amarnath Murthy_, Mar 27 2002

%E Edited and extended by _Robert G. Wilson v_, Apr 03 2002