A143115 a(n) = the smallest positive multiple of n that has exactly n 1's in its binary representation.
1, 6, 21, 60, 55, 126, 623, 2040, 1503, 3070, 3839, 16380, 16367, 94206, 96255, 1048560, 483327, 524286, 1040383, 4194300, 5767167, 16515070, 16252927, 134217720, 66584575, 251658238, 402651135, 5234491388, 1073741791
Offset: 1
Examples
For n = 3, checking: 3*1=3 (11 in binary, two 1's). 3*2=6 (110 in binary, two 1's). 3*3=9 (1001 in binary, two 1's). 3*4=12 (1100 in binary, two 1's). 3*5=15 (1111 in binary, four 1's). 3*6=18 (10010 in binary, two 1's). 3*7=21 (10101 in binary, three 1's). So a(3) = 21.
Links
- Ray Chandler, Table of n, a(n) for n = 1..2024
Crossrefs
Cf. A143116.
Programs
-
Maple
a:=proc(n) local k: for k while add(convert(k*n, base, 2)[j], j=1..nops(convert(k*n, base, 2))) <> n do end do: k*n end proc: seq(a(n),n=1..16); # Emeric Deutsch, Aug 16 2008
-
Mathematica
Fold[Append[#1, SelectFirst[Range[2^#2] #2, Function[k, DigitCount[k, 2, 1] == #2]]] &, {1}, Range[2, 20]] (* Michael De Vlieger, Oct 25 2017 *)
Formula
a(n) = n*A102032(n). - Vladeta Jovovic, Sep 17 2008
Extensions
More terms from Emeric Deutsch, Aug 16 2008
a(17) to a(27) from Owen Whitby, Oct 22 2008. For n=28,29,30 if a(n) exists it is greater than 20000000n.
a(28)-a(29) from Ray Chandler, Nov 11 2008