OFFSET
1,1
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
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
