login
a(1) = 8; a(n) = smallest number such that the juxtaposition a(1)a(2)...a(n) is a prime.
22

%I #15 Aug 03 2021 11:47:42

%S 8,3,9,11,7,21,23,3,7,29,3,99,9,93,1,39,33,21,137,123,57,13,191,3,163,

%T 9,143,63,21,157,521,163,161,43,161,109,107,121,423,57,71,7,173,469,

%U 107,57,177,411,49,149,61,291,413,271,299,693,349,149,73,299,271,521

%N a(1) = 8; a(n) = smallest number such that the juxtaposition a(1)a(2)...a(n) is a prime.

%e a(4) = 11 and the number 83911 is a prime.

%t a[1] = 8; a[n_] := a[n] = Block[{k = 1, c = IntegerDigits @ Table[ a[i], {i, n - 1}]}, While[ !PrimeQ[ FromDigits @ Flatten @ Append[c, IntegerDigits[k]]], k += 2]; k]; Table[ a[n], {n, 63}] (* _Robert G. Wilson v_, Aug 05 2005 *)

%o (Python)

%o from sympy import isprime

%o def aupton(terms):

%o alst, astr = [8], '8'

%o for n in range(2, terms+1):

%o an = 1

%o while not isprime(int(astr + str(an))): an += 2

%o alst, astr = alst + [an], astr + str(an)

%o return alst

%o print(aupton(62)) # _Michael S. Branicky_, Aug 03 2021

%Y Cf. A046258, A074344, A092528, A069603, A069605, A069606, A069607, A069608, A069609, A069610, A069611, A111525.

%K nonn,base

%O 1,1

%A _Amarnath Murthy_, Mar 26 2002

%E More terms from _Jason Earls_, Jun 13 2002