OFFSET
1,1
COMMENTS
As all the numbers 10,20,...,90,100 are terms, all numbers that are recursively 10 times these values are also terms as they just add an additional 2 and 5 to their parent's prime factor list.
A number 999...9998 will be a term if it has two prime factors 2 and 4999...999. Therefore 999999999999998 and 999...9998 (with 54 9's) are both terms. See A056712.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..884 (terms 1..458 from Scott R. Shannon; all terms < 10^18)
EXAMPLE
42 is a term as 42 = 2 * 3 * 7, and 42 has nonincreasing digits while its prime factor concatenation "237" has nondecreasing digits.
PROG
(Python)
from sympy import factorint, isprime
from itertools import count, islice, combinations_with_replacement as mc
def nd(s): return s == "".join(sorted(s))
def bgen(d):
yield from ("".join(m) for m in mc("9876543210", d) if m[0]!="0")
def agen(): # generator of terms
for d in count(1):
out = set()
for s in bgen(d):
t = int(s)
if t < 4 or isprime(t): continue
if nd("".join(str(p)*e for p, e in factorint(t).items())):
out.add(t)
yield from sorted(out)
print(list(islice(agen(), 65))) # Michael S. Branicky, Apr 26 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Scott R. Shannon, Apr 26 2024
STATUS
approved