login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A127828 Largest n-digit emirp (A006567) with nonincreasing digits. 2

%I #13 Jun 27 2022 01:11:24

%S 97,991,9941,99881,999983,9999971,99999643,999999761,9999999511,

%T 99999999977,999999998863,9999999998633,99999999998333,

%U 999999999999877,9999999999998633,99999999999987443,999999999999999331,9999999999999988633,99999999999999999631

%N Largest n-digit emirp (A006567) with nonincreasing digits.

%H Michael S. Branicky, <a href="/A127828/b127828.txt">Table of n, a(n) for n = 2..527</a>

%t 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 *)

%o (Python)

%o from sympy import isprime

%o from itertools import count, islice, combinations_with_replacement as mc

%o def bgen(d):

%o nd = ("".join(m) for m in mc("987654321", d))

%o yield from filter(isprime, map(int, nd))

%o def ok(ndp):

%o s = str(ndp)

%o return len(set(s)) != 1 and isprime(int(s[::-1]))

%o def agen():

%o yield from (next(filter(ok, bgen(d))) for d in count(2))

%o print(list(islice(agen(), 20))) # _Michael S. Branicky_, Jun 26 2022

%Y Cf. A006567, A030540, A114019, A127748, A127827.

%K nonn,base

%O 2,1

%A _Ray Chandler_, Jan 31 2007

%E a(19) and beyond from _Michael S. Branicky_, Jun 26 2022

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 03:01 EDT 2024. Contains 371767 sequences. (Running on oeis4.)