login
A386761
a(n) is the least number with exactly two distinct base-10 digits and exactly n distinct prime factors, or -1 if there is no such number.
0
13, 10, 30, 330, 6006, 30030, 1111110, 200222022, 1001110110, 955559599995, 1000110001000110, 11011101101110110, 11111100000101111010, 200220200202022022022
OFFSET
1,1
COMMENTS
a(n) is the least term k of A031955, if it exists, such that A001221(k) = n.
EXAMPLE
a(4) = 330 because 330 has two distinct digits 3 and 0, and four distinct prime factors 2, 3, 5 and 11, and no smaller number works.
MAPLE
G:= proc(d)
local S, a, b, s, q, r, i;
S:= {}:
for s in combinat:-powerset({$0..d-1}) minus {{}, {$0..d-1}} do
q:= add(10^i, i=s);
r:= (10^d-1)/9 - q;
S:= S union {seq(seq(a*q+b*r, b = a+1..9), a = `if`(q < 10^(d-1), 0, 1) .. 8)};
od;
S:= sort(convert(S, list));
end proc:
M:= 12: # for a(1) .. a(M)
V:= Vector(M): count:= 0:
for d from 2 while count < M do
for x in G(d) while count < M do
v:=NumberTheory:-NumberOfPrimeFactors(x, distinct);
if v <= M and V[v] = 0 then
count:= count+1; V[v]:= x;
fi
od
od:
convert(V, list);
PROG
(Python)
from sympy import factorint
from itertools import count, product, islice
def bgen(): # generator of A031955
for d in count(2):
yield from sorted(int("".join(t)) for f in "123456789" for r in "0123456789" if f!=r for s in product(f+r, repeat=d-1) if len(set(t:=(f, )+s)) == 2)
def agen(): # generator of terms
n, adict = 1, dict()
for t in bgen():
v = len(factorint(t))
if v not in adict:
adict[v] = t
while n in adict: yield adict[n]; n += 1
print(list(islice(agen(), 9))) # Michael S. Branicky, Oct 11 2025
CROSSREFS
Sequence in context: A291425 A180864 A206608 * A094813 A364712 A152298
KEYWORD
nonn,base,more
AUTHOR
Robert Israel, Oct 06 2025
EXTENSIONS
a(13) from Michael S. Branicky, Oct 11 2025
a(14) from Daniel Suteu, Oct 22 2025
STATUS
approved