This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A363963 #14 Apr 05 2024 13:07:07 %S A363963 1,987654103,987654301,9876541023,9876542103,9876543102,9876543201, %T A363963 9876543210,9876542130,9876543120,9876534120,9876345120,9876514032, %U A363963 9876431250,9876045312,9875324160,9876523104,9863147520,9875312640,9635217408,9845637120,9715064832,9574023168,9805234176,5892341760,6398410752,-1,-1,-1,536870912 %N A363963 a(n) is the greatest number with distinct decimal digits and n prime factors, counted with multiplicity, or -1 if there is no such number. %C A363963 a(n) = -1 for n > 29. %e A363963 a(2) = 987654301 = 486769*2029 has distinct digits and 2 prime factors counted with multiplicity, and is the largest such number. %p A363963 N:= 29: V:= Array(0..N,-1): %p A363963 for m from 10 to 1 by -1 do %p A363963 for L in combinat:-permute([9,8,7,6,5,4,3,2,1,0],m) while count < N do %p A363963 if L[1] = 0 then break fi; %p A363963 x:= add(L[i]*10^(m-i),i=1..m); %p A363963 v:= numtheory:-bigomega(x); %p A363963 if v <= N and V[v] = -1 then V[v]:= x; count:= count+1 fi %p A363963 od od: %p A363963 convert(V,list); %o A363963 (Python) %o A363963 from sympy import primeomega %o A363963 from itertools import count, islice, permutations as P %o A363963 def agen(): # generator of terms %o A363963 n, adict = 0, {0:1, 1:987654103, 2:987654301} # a(1), a(2) take a while %o A363963 D = [p for d in range(10, 0, -1) for p in P("9876543210", d) if p[0] != "0"] %o A363963 for k in (int("".join(t)) for t in D): %o A363963 v = primeomega(k) %o A363963 if v not in adict: %o A363963 adict[v] = k %o A363963 while n in adict: yield adict[n]; n += 1 %o A363963 yield from (adict[n] if n in adict else -1 for n in count(n)) %o A363963 print(list(islice(agen(), 19))) # _Michael S. Branicky_, Apr 05 2024 %Y A363963 Cf. A029743, A320969. %K A363963 sign,base %O A363963 0,2 %A A363963 _Zak Seidov_ and _Robert Israel_, Jun 29 2023