|
|
A143115
|
|
a(n) = the smallest positive multiple of n that has exactly n 1's in its binary representation.
|
|
4
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
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.
|
|
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 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
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.
|
|
STATUS
|
approved
|
|
|
|