OFFSET
0,2
COMMENTS
a(n) = -1 for n > 29.
EXAMPLE
a(2) = 987654301 = 486769*2029 has distinct digits and 2 prime factors counted with multiplicity, and is the largest such number.
MAPLE
N:= 29: V:= Array(0..N, -1):
for m from 10 to 1 by -1 do
for L in combinat:-permute([9, 8, 7, 6, 5, 4, 3, 2, 1, 0], m) while count < N do
if L[1] = 0 then break fi;
x:= add(L[i]*10^(m-i), i=1..m);
v:= numtheory:-bigomega(x);
if v <= N and V[v] = -1 then V[v]:= x; count:= count+1 fi
od od:
convert(V, list);
PROG
(Python)
from sympy import primeomega
from itertools import count, islice, permutations as P
def agen(): # generator of terms
n, adict = 0, {0:1, 1:987654103, 2:987654301} # a(1), a(2) take a while
D = [p for d in range(10, 0, -1) for p in P("9876543210", d) if p[0] != "0"]
for k in (int("".join(t)) for t in D):
v = primeomega(k)
if v not in adict:
adict[v] = k
while n in adict: yield adict[n]; n += 1
yield from (adict[n] if n in adict else -1 for n in count(n))
print(list(islice(agen(), 19))) # Michael S. Branicky, Apr 05 2024
CROSSREFS
KEYWORD
sign,base
AUTHOR
Zak Seidov and Robert Israel, Jun 29 2023
STATUS
approved