|
|
A161765
|
|
a(n) is the smallest multiple of {the number of 1's in the binary representation of n} that is >= n.
|
|
2
|
|
|
1, 2, 4, 4, 6, 6, 9, 8, 10, 10, 12, 12, 15, 15, 16, 16, 18, 18, 21, 20, 21, 24, 24, 24, 27, 27, 28, 30, 32, 32, 35, 32, 34, 34, 36, 36, 39, 39, 40, 40, 42, 42, 44, 45, 48, 48, 50, 48, 51, 51, 52, 54, 56, 56, 55, 57, 60, 60, 60, 60, 65, 65, 66, 64, 66, 66, 69, 68, 69, 72, 72, 72
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
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
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|