cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A143115 a(n) = the smallest positive multiple of n that has exactly n 1's in its binary representation.

This page as a plain text file.
%I A143115 #16 Oct 27 2017 00:45:55
%S A143115 1,6,21,60,55,126,623,2040,1503,3070,3839,16380,16367,94206,96255,
%T A143115 1048560,483327,524286,1040383,4194300,5767167,16515070,16252927,
%U A143115 134217720,66584575,251658238,402651135,5234491388,1073741791
%N A143115 a(n) = the smallest positive multiple of n that has exactly n 1's in its binary representation.
%H A143115 Ray Chandler, <a href="/A143115/b143115.txt">Table of n, a(n) for n = 1..2024</a>
%F A143115 a(n) = n*A102032(n). - _Vladeta Jovovic_, Sep 17 2008
%e A143115 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.
%p A143115 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
%t A143115 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 *)
%Y A143115 Cf. A143116.
%K A143115 base,nonn
%O A143115 1,2
%A A143115 _Leroy Quet_, Jul 25 2008
%E A143115 More terms from _Emeric Deutsch_, Aug 16 2008
%E A143115 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.
%E A143115 a(28)-a(29) from _Ray Chandler_, Nov 11 2008