%I #14 Mar 11 2014 01:32:26
%S 1,1,5,1,3,5,11,1,5,3,7,5,7,11,23,1,3,5,7,3,11,7,15,5,7,7,23,11,15,23,
%T 47,1,5,3,11,5,7,7,23,3,7,11,15,7,23,15,31,5,11,7,23,7,15,23,31,11,23,
%U 15,31,23,31,47,95,1,3,5,7,3,7,11,15,5,7,7,23,7,15,23,31,3,7,7,15,11
%N a(n) = the smallest positive integer that is coprime to n and has the same number of 1's in its binary representation as n has in binary.
%H Owen Whitby, <a href="/A143113/b143113.txt">Table of n, a(n) for n = 1..200</a>
%e For n = 27: 27 in binary is 11011, which has four 1's. The positive integers that each have four 1's in their binary representations are 15,23,27,29, etc. The smallest of these that is coprime to 27 is 23. So a(27) = 23.
%t cp[n_]:=Module[{k=1,dcn=DigitCount[n,2,1]},While[!CoprimeQ[n,k] || DigitCount[ k,2,1] != dcn,k++];k]; Array[cp,90] (* _Harvey P. Dale_, Aug 13 2012 *)
%Y Cf. A143114.
%K base,nonn
%O 1,3
%A _Leroy Quet_, Jul 25 2008
%E a(31) to a(200) from _Owen Whitby_, Oct 22 2008