%I #13 Sep 05 2015 11:10:35
%S 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 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 52,53,9,5,8,19,58,59,4,61,2,1,64,65,66,67,68,69,70,71
%N 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 Paul Tek, <a href="/A161399/b161399.txt">Table of n, a(n) for n = 1..10000</a>
%p with(numtheory):
%p z:= proc(n) local m, r; m, r:=n, 0;
%p while m>1 do r:= r+1-irem(m, 2, 'm'); r od
%p end:
%p a:= proc(n) local d, t; t:=z(n);
%p for d in sort([divisors(n)[]]) do
%p if z(d)=t then return d fi od
%p end:
%p seq(a(n), n=0..100); # _Alois P. Heinz_, Jun 23 2013
%t 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 Cf. A161398.
%K base,nonn
%O 1,2
%A _Leroy Quet_, Jun 09 2009