OFFSET
1,2
COMMENTS
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..58 (terms below 10^10)
EXAMPLE
MATHEMATICA
seq[nmax_] := Module[{s = {}, rm = 0, r}, Do[If[(r = DivisorSum[n, DigitCount[#, 2, 1] &]/DigitCount[n, 2, 1]) > rm, rm = r; AppendTo[s, n]], {n, 1, nmax}]; s]; seq[10^4]
PROG
(PARI) lista(kmax) = {my(rm = 0, r); for(k = 1, kmax, r = sumdiv(k, d, hammingweight(d))/hammingweight(k); if(r > rm, rm = r; print1(k, ", "))); }
from itertools import count, islice
def agen(r=0): yield from ((m, r:=fm)[0] for m in count(1) if (fm:=f(m))>r)
print(list(islice(agen(), 34))) # Michael S. Branicky, Feb 15 2023
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, Feb 15 2023
STATUS
approved