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 A364040 #12 Apr 05 2024 13:02:21 %S A364040 1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,98304, %T A364040 327680,917504,786432,1048576,3145728,15728640,31457280,2845310976, %U A364040 6398410752,-1,-1,-1,536870912 %N A364040 a(n) is the least positive number with distinct decimal digits and n prime factors, counted with multiplicity, or -1 if there is no such number. %C A364040 a(n) = -1 for n > 29. %e A364040 a(5) = 32 = 2^5 has distinct decimal digits and 5 prime factors counted with multiplicity. %p A364040 V:= Array(0..29,-1): count:= 0: %p A364040 for m from 1 to 10 do %p A364040 for L in combinat:-permute([$0..9],m) while count < 27 do %p A364040 if L[1] = 0 then next fi; %p A364040 x:= add(L[i]*10^(m-i),i=1..m); %p A364040 v:= numtheory:-bigomega(x); %p A364040 if V[v] = -1 then V[v]:= x; count:= count+1 fi; %p A364040 od; %p A364040 od: %p A364040 convert(V,list); %o A364040 (Python) %o A364040 from sympy import primeomega %o A364040 from itertools import count, islice, permutations as P %o A364040 def agen(): # generator of terms %o A364040 adict, n = dict(), 0 %o A364040 D = [p for d in range(1, 11) for p in P("0123456789", d) if p[0] != "0"] %o A364040 for k in (int("".join(t)) for t in D): %o A364040 v = primeomega(k) %o A364040 if v not in adict: %o A364040 adict[v] = k %o A364040 while n in adict: yield adict[n]; n += 1 %o A364040 yield from (adict[n] if n in adict else -1 for n in count(n)) %o A364040 print(list(islice(agen(), 22))) # _Michael S. Branicky_, Apr 05 2024 %Y A364040 Cf. A363963. %K A364040 sign,base %O A364040 0,2 %A A364040 _Zak Seidov_ and _Robert Israel_, Jul 02 2023