OFFSET
1,3
LINKS
Owen Whitby, Table of n, a(n) for n = 1..200
EXAMPLE
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.
MATHEMATICA
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 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Jul 25 2008
EXTENSIONS
a(31) to a(200) from Owen Whitby, Oct 22 2008
STATUS
approved