OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
11 (decimal) in binary is 1011. There are three 1's. Because 12 is the smallest multiple of 3 that is >= 11, then a(11) = 12.
MAPLE
a := proc (n) local n2, s, j: n2 := convert(n, base, 2): s := add(n2[i], i = 1 .. nops(n2)): for j while j*s < n do end do: j*s end proc: seq(a(n), n = 1 .. 80); # Emeric Deutsch, Jun 24 2009
MATHEMATICA
Table[d=DigitCount[n, 2, 1]; d*Ceiling[n/d], {n, 80}] (* Harvey P. Dale, Aug 23 2013 *)
PROG
(PARI) a(n) = my(nb = hammingweight(n)); nb*ceil(n/nb); \\ Michel Marcus, Nov 11 2018
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Jun 18 2009
EXTENSIONS
Extended by Emeric Deutsch, Jun 24 2009
STATUS
approved