A068693
Smallest n-digit prime with all odd digits.
Original entry on oeis.org
3, 11, 113, 1117, 11113, 111119, 1111151, 11111117, 111111113, 1111111139, 11111111113, 111111111337, 1111111111139, 11111111111533, 111111111111713, 1111111111111153, 11111111111111119, 111111111111111131, 1111111111111111111, 11111111111111111131
Offset: 1
A068692
Largest n-digit prime with all even digits except for the least significant digit.
Original entry on oeis.org
7, 89, 887, 8887, 88883, 888887, 8888861, 88888883, 888888887, 8888888809, 88888888801, 888888888887, 8888888888849, 88888888888889, 888888888888883, 8888888888888647, 88888888888888889, 888888888888888809, 8888888888888888881, 88888888888888888867, 888888888888888888683
Offset: 1
-
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);
-
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 *)
A068694
Largest n-digit prime with all odd digits.
Original entry on oeis.org
7, 97, 997, 9973, 99991, 999979, 9999991, 99999971, 999999937, 9999999557, 99999999977, 999999999959, 9999999999971, 99999999999973, 999999999999577, 9999999999999937, 99999999999999997, 999999999999999737
Offset: 1
Showing 1-3 of 3 results.