OFFSET
1,2
COMMENTS
1 is the only integer of the form 2^k -1 (k>=0) included in this sequence, because such integers contain no binary 0's, and 0 is considered here to be coprime only to 1.
LINKS
Indranil Ghosh, Table of n, a(n) for n = 1..1000
EXAMPLE
13 is in the sequence because the number of non-leading 0 s in the binary representation of 13 is 1 (13_10 = 1101_2) and gcd(1, 13) = 1. - Indranil Ghosh, Mar 08 2017
MATHEMATICA
Select[Range[115], GCD[DigitCount[#, 2, 0], #] == 1 &] (* Indranil Ghosh, Mar 08 2017 *)
PROG
(PARI) b(n) = if(n<1, 0, b(n\2) + 1 - n%2);
for (n=1, 115, if(gcd(b(n), n)==1, print1(n", "))); \\ Indranil Ghosh, Mar 08 2017
(Python)
from fractions import gcd
i=j=1
while j<=100:
if gcd(bin(i)[2:].count("0"), i)==1:
print(str(j)+" "+str(i))
j+=1
i+=1 # Indranil Ghosh, Mar 08 2017
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Jun 03 2009
EXTENSIONS
Extended by Ray Chandler, Jun 11 2009
STATUS
approved