OFFSET
1,2
COMMENTS
a(n) is the least number k such that A385494(k) = n.
LINKS
Robert Israel, Table of n, a(n) for n = 1..400
FORMULA
A385494(a(n)) = n.
EXAMPLE
a(6) = 110 because of the divisors of 110, 1 and 10 each have one 1, 11 and 110 each have two, for a total of 6, and no smaller number works.
MAPLE
f:= proc(n) local t;
add(numboccur(1, convert(t, base, 10)), t = numtheory:-divisors(n))
end proc:
N:= 100: # for a(1)..a(N)
V:= Vector(N): count:= 0:
for x from 1 do
v:= f(x);
if v <= N and V[v] = 0 then V[v]:= x; count:= count+1; if count = N then break fi fi;
od:
convert(V, list);
MATHEMATICA
a[n_]:=Module[{k=1}, While[Count[IntegerDigits[Divisors[k]]//Flatten, 1]!=n, k++]; k]; Array[a, 48] (* Stefano Spezia, Aug 28 2025 *)
PROG
(Python)
from sympy import divisors
from itertools import count, islice
def f(n): return sum(str(d).count("1") for d in divisors(n, generator=True))
def agen(): # generator of terms
n, adict = 1, dict()
for k in count(1):
v = f(k)
if v not in adict:
adict[v] = k
while n in adict: yield adict[n]; n += 1
print(list(islice(agen(), 50))) # Michael S. Branicky, Aug 27 2025
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel, Aug 27 2025
STATUS
approved
