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.

A161765 a(n) is the smallest multiple of {the number of 1's in the binary representation of n} that is >= n.

This page as a plain text file.
%I A161765 #19 Nov 12 2018 15:52:09
%S A161765 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,
%T A161765 27,28,30,32,32,35,32,34,34,36,36,39,39,40,40,42,42,44,45,48,48,50,48,
%U A161765 51,51,52,54,56,56,55,57,60,60,60,60,65,65,66,64,66,66,69,68,69,72,72,72
%N A161765 a(n) is the smallest multiple of {the number of 1's in the binary representation of n} that is >= n.
%H A161765 G. C. Greubel, <a href="/A161765/b161765.txt">Table of n, a(n) for n = 1..10000</a>
%F A161765 a(n) = A000120(n)*ceiling(n/A000120(n)). - _Michel Marcus_, Nov 11 2018
%e A161765 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.
%p A161765 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
%t A161765 Table[d=DigitCount[n,2,1];d*Ceiling[n/d],{n,80}] (* _Harvey P. Dale_, Aug 23 2013 *)
%o A161765 (PARI) a(n) = my(nb = hammingweight(n)); nb*ceil(n/nb); \\ _Michel Marcus_, Nov 11 2018
%Y A161765 Cf. A161764, A000120.
%K A161765 base,nonn
%O A161765 1,2
%A A161765 _Leroy Quet_, Jun 18 2009
%E A161765 Extended by _Emeric Deutsch_, Jun 24 2009