%I #13 Aug 10 2022 07:40:46
%S 89,991,9949,99991,999961,9999991,99999989,999999491,9999999881,
%T 99999999689,999999999989,9999999999161,99999999999481,
%U 999999999999989,9999999999999641,99999999999999961,999999999999999989,9999999999999999961,99999999999999999989
%N Largest n-digit zeroless prime with nonprime digits.
%H Michael S. Branicky, <a href="/A103545/b103545.txt">Table of n, a(n) for n = 2..1000</a>
%t PrevPrim[n_] := Block[{k = n - 1}, While[ !PrimeQ[k], k-- ]; k]; f[n_] := Block[{pp = PrevPrim[ 10^n]}, While[ Union[ Join[{1, 4, 6, 8, 9}, IntegerDigits[pp]]] != {1, 4, 6, 8, 9}, pp = PrevPrim[pp]]; pp]; Table[ f[n], {n, 2, 18}] (* _Robert G. Wilson v_, Mar 26 2005 *)
%o (Python)
%o from sympy import isprime
%o from itertools import product
%o def a(n):
%o for p in product("98641", repeat=n):
%o t = int("".join(p))
%o if isprime(t): return t
%o print([a(n) for n in range(2, 22)]) # _Michael S. Branicky_, Aug 10 2022
%Y Cf. A103544.
%K base,nonn
%O 2,1
%A _Ray G. Opao_, Mar 22 2005
%E More terms from _Jonathan Vos Post_, Mar 23 2005
%E a(7) to a(12) from _Jonathan Vos Post_, Mar 23 2005
%E a(13) to a(18) from _Robert G. Wilson v_, Mar 26 2005
%E a(19) and beyond from _Michael S. Branicky_, Aug 10 2022