OFFSET
1,2
COMMENTS
a(n) is the least number k such that for some s, there are exactly n divisors of k with sum of digits s.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..289
Michael S. Branicky, Table of n, a(n) for all terms <= 446000000
FORMULA
a(n) <= 10^(n-1). - Rémy Sigrist, Jan 27 2023
EXAMPLE
a(1) = 1 because 1 has 1 divisor with digit sum 1, namely 1.
a(2) = 10 because 10 has 2 divisors with digit sum 1, namely 1 and 10.
a(3) = 36 because 36 has 3 divisors with digit sum 9, namely 9, 18 and 36.
a(4) = 54 because 54 has 4 divisors with digit sum 9, namely 9, 18, 27 and 54.
MAPLE
f:= proc(n) local L, S;
L:= convert(numtheory:-divisors(n), list);
S:= map(t -> convert(convert(t, base, 10), `+`), L);
map(t -> numboccur(t, S), convert(S, set))
end proc:
V:= Vector(50): count:= 0:
for n from 1 while count < 50 do
for v in f(n) do
if v <= 50 and V[v] = 0 then V[v]:= n; count:= count+1; fi
od od:
convert(V, list);
PROG
(PARI) is(z, n)={my(e=1, w=[], s=[], t=0); s=vecsort(apply(vecsum, apply(digits, apply(divisors, z)))); for(i=2, #s, if(s[i]==s[i-1], e++, w=concat(w, e); e=1)); w=concat(w, e); s=Set(w); forvec(G=vector(2, j, [1, #s]), if((s[G[1]]==n)&&(s[G[2]]==n), t=1; if(G[1]!=G[2], return(0)))); return(t)}
a(n)=for(z=1, +oo, is(z, n)&&return(z)); \\ R. J. Cano, Jan 23 2023
(Python)
from sympy import divisors
from collections import Counter
from itertools import count, islice
def sd(n): return sum(map(int, str(n)))
def agen(): # generator of terms
adict, n = dict(), 1
for k in count(1):
c = Counter(sd(d) for d in divisors(k, generator=True))
for v in c.values():
if v >= n and v not in adict:
adict[v] = k
while n in adict: yield adict[n]; n += 1
print(list(islice(agen(), 50))) # Michael S. Branicky, Jan 27 2023
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel, Jan 19 2023
STATUS
approved