login
A387464
a(n) is the first number with a total of exactly n 3's in the decimal digits of its divisors.
4
1, 3, 30, 33, 132, 333, 330, 660, 1320, 1980, 2310, 2772, 3960, 6660, 6732, 8190, 13104, 6930, 18480, 22176, 16380, 35910, 13860, 30030, 43890, 32760, 27720, 41580, 71820, 73920, 55440, 65520, 120120, 69300, 83160, 124740, 139230, 117810, 110880, 131670, 196560, 279720, 210672, 214830, 166320
OFFSET
0,2
COMMENTS
a(n) is the least number k such that A387463(k) = n.
LINKS
FORMULA
A387463(a(n)) = n.
EXAMPLE
a(4) = 132 because of the divisors of 132, 3 and 132 each have one 3 and 33 has two, for a total of 4, and no smaller number works.
MAPLE
ff:= proc(n) option remember; numboccur(3, convert(n, base, 10)) end proc:
f:= proc(n) local d; add(ff(d), d=numtheory:-divisors(n)) end proc:
V:= Array(0..50): count:= 0:
for x from 1 while count < 51 do
v:= f(x); if v <= 50 and V[v] = 0 then V[v]:= x; count:= count+1; fi
od:
convert(V, list);
MATHEMATICA
a[n_]:=Module[{i=0}, Until[Count[IntegerDigits/@Divisors[i]//Flatten, 3]==n, i++]; i]; Array[a, 45, 0] (* James C. McMahon, Sep 05 2025 *)
PROG
(Python)
from sympy import divisors
from itertools import count, islice
def f(n): return sum(str(d).count("3") for d in divisors(n, generator=True))
def agen(): # generator of terms
n, adict = 0, 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(), 45))) # Michael S. Branicky, Aug 29 2025
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel, Aug 29 2025
STATUS
approved