OFFSET
1,1
LINKS
Michel Lagneau, Michael De Vlieger and Robert G. Wilson v, Table of n, a(n) for n = 1..1225
MATHEMATICA
f[n_] := Block[{k = 0, p = {}, r = (10^n - 1), s = Range@ 10 - 10}, While[k < n - 0, AppendTo[p, Select[r + 10^k*s, PrimeQ]]; k++]; p = Min@ Flatten@ p]; Array[f, 20]
PROG
(PARI) a(n)=my(t=10^n-1, p); forstep(d=n-1, 0, -1, forstep(k=8, 1, -1, p=t-10^d*k; if(ispseudoprime(p), return(p)))); -1 \\ Charles R Greathouse IV, Mar 21 2016
CROSSREFS
KEYWORD
nonn,base
AUTHOR
STATUS
approved