OFFSET
1,2
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..82 (all terms < 10^8)
EXAMPLE
prime(7531) = 76543.
MATHEMATICA
Select[Range[9000], Max[Differences[IntegerDigits[#]]]< 1 && Max[ Differences[ IntegerDigits[ Prime[#]]]]<1&] (* Harvey P. Dale, Oct 11 2021 *)
PROG
(Python)
from sympy import sieve
from itertools import count, islice, combinations_with_replacement as mc
def ni(n): s = str(n); return s == "".join(sorted(s, reverse=True))
def bgen(d):
ni = map(int, ("".join(m) for m in mc("9876543210", d)))
yield from sorted(k for k in ni if k != 0)
def agen():
for d in count(1):
yield from (k for k in bgen(d) if ni(sieve[k]))
print(list(islice(agen(), 52))) # Michael S. Branicky, Jun 26 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Giovanni Resta, Feb 13 2006
EXTENSIONS
a(51) and beyond from Michael S. Branicky, Jun 26 2022
STATUS
approved