login
Smallest prime starting with A000422(n).
2

%I #17 Apr 01 2020 12:13:32

%S 11,211,3217,432121,543217,65432117,76543217,876543211,9876543211,

%T 1098765432101,11109876543211,12111098765432101,1312111098765432139,

%U 141312111098765432113,15141312111098765432173

%N Smallest prime starting with A000422(n).

%H Chai Wah Wu, <a href="/A053547/b053547.txt">Table of n, a(n) for n = 1..100</a>

%e a(6)=65432117 is smallest prime beginning with the string 654321.

%t Flatten[Select[Join[10 #+Range[1,9,2],100 #+Range[1,99,2]],PrimeQ,1]&/@ Table[FromDigits[Flatten[IntegerDigits/@Range[n,1,-1]]],{n,25}]] (* _Harvey P. Dale_, Nov 04 2011 *)

%o (Python)

%o from sympy import isprime

%o def A053547(n):

%o s = int(''.join(str(m) for m in range(n,0,-1)))

%o for i in range(1,10):

%o s *= 10

%o for j in range(1,10**i,2):

%o x = s+j

%o if isprime(x):

%o return x

%o else:

%o return 'search limit reached.' # _Chai Wah Wu_, Jan 02 2015

%Y Cf. A000422.

%K easy,nice,nonn,base

%O 1,1

%A _Enoch Haga_, Jan 16 2000