|
|
A127828
|
|
Largest n-digit emirp (A006567) with nonincreasing digits.
|
|
2
|
|
|
97, 991, 9941, 99881, 999983, 9999971, 99999643, 999999761, 9999999511, 99999999977, 999999998863, 9999999998633, 99999999998333, 999999999999877, 9999999999998633, 99999999999987443, 999999999999999331, 9999999999999988633, 99999999999999999631
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
2,1
|
|
LINKS
|
|
|
MATHEMATICA
|
nde[n_]:=Module[{p=NextPrime[10^n, -1]}, While[Max[Differences[ IntegerDigits[ p]]]>0 || CompositeQ[IntegerReverse[p]], p=NextPrime[ p, -1]]; p]; Array[nde, 17, 2] (* Harvey P. Dale, Mar 13 2020 *)
|
|
PROG
|
(Python)
from sympy import isprime
from itertools import count, islice, combinations_with_replacement as mc
def bgen(d):
nd = ("".join(m) for m in mc("987654321", d))
yield from filter(isprime, map(int, nd))
def ok(ndp):
s = str(ndp)
return len(set(s)) != 1 and isprime(int(s[::-1]))
def agen():
yield from (next(filter(ok, bgen(d))) for d in count(2))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|