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.
%I A161399 #13 Sep 05 2015 11:10:35 %S A161399 1,2,1,4,5,2,1,8,9,10,11,4,13,2,1,16,17,18,19,20,21,22,23,8,25,26,27, %T A161399 4,29,2,1,32,33,34,35,36,37,38,39,40,41,42,43,44,9,46,47,16,49,50,51, %U A161399 52,53,9,5,8,19,58,59,4,61,2,1,64,65,66,67,68,69,70,71 %N A161399 a(n) = the smallest divisor of n that contains the same number of (non-leading) 0's as n when both numbers are written in binary. %H A161399 Paul Tek, <a href="/A161399/b161399.txt">Table of n, a(n) for n = 1..10000</a> %p A161399 with(numtheory): %p A161399 z:= proc(n) local m, r; m, r:=n, 0; %p A161399 while m>1 do r:= r+1-irem(m, 2, 'm'); r od %p A161399 end: %p A161399 a:= proc(n) local d, t; t:=z(n); %p A161399 for d in sort([divisors(n)[]]) do %p A161399 if z(d)=t then return d fi od %p A161399 end: %p A161399 seq(a(n), n=0..100); # _Alois P. Heinz_, Jun 23 2013 %t A161399 sdn[n_]:=SelectFirst[Divisors[n],DigitCount[#,2,0]==DigitCount[n,2,0]&]; Array[sdn,80] (* The program uses the SelectFirst function from Mathematica version 10 *) (* _Harvey P. Dale_, Sep 05 2015 *) %Y A161399 Cf. A161398. %K A161399 base,nonn %O A161399 1,2 %A A161399 _Leroy Quet_, Jun 09 2009