OFFSET
2,1
LINKS
Michael S. Branicky, Table of n, a(n) for n = 2..1000
MATHEMATICA
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 *)
PROG
(Python)
from sympy import isprime
from itertools import product
def a(n):
for p in product("98641", repeat=n):
t = int("".join(p))
if isprime(t): return t
print([a(n) for n in range(2, 22)]) # Michael S. Branicky, Aug 10 2022
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Ray G. Opao, Mar 22 2005
EXTENSIONS
More terms from Jonathan Vos Post, Mar 23 2005
a(7) to a(12) from Jonathan Vos Post, Mar 23 2005
a(13) to a(18) from Robert G. Wilson v, Mar 26 2005
a(19) and beyond from Michael S. Branicky, Aug 10 2022
STATUS
approved