login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A068692
Largest n-digit prime with all even digits except for the least significant digit.
3
7, 89, 887, 8887, 88883, 888887, 8888861, 88888883, 888888887, 8888888809, 88888888801, 888888888887, 8888888888849, 88888888888889, 888888888888883, 8888888888888647, 88888888888888889, 888888888888888809
OFFSET
1,1
MAPLE
for n from 1 to 40 do a := prevprime((10^n-1)/9*8+2):b := convert(a, base, 10):c := true:for i from 2 to nops(b) do if((b[i] mod 2)>0) then c := false:end if:end do:while(c=false) do a := prevprime(a):b := convert(a, base, 10):c := true:for i from 2 to nops(b) do if((b[i] mod 2)>0) then c := false:end if:end do:end do:q[n] := a:end do:seq(q[k], k=1..40);
MATHEMATICA
nped[n_]:=Module[{p=NextPrime[9*10^n, -1]}, While[AnyTrue[Most[ IntegerDigits[ p]], OddQ], p=NextPrime[p, -1]]; p]; Array[nped, 20, 0] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 14 2018 *)
CROSSREFS
Sequence in context: A071363 A174616 A089394 * A178006 A053302 A068877
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Mar 03 2002
EXTENSIONS
More terms from Sascha Kurz, Mar 26 2002
STATUS
approved