login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A161153
Positive integers that are coprime to their number of digits in binary representation.
5
1, 3, 4, 5, 7, 9, 11, 13, 15, 16, 17, 18, 19, 21, 22, 23, 24, 26, 27, 28, 29, 31, 35, 37, 41, 43, 47, 49, 53, 55, 59, 61, 64, 65, 66, 67, 68, 69, 71, 72, 73, 74, 75, 76, 78, 79, 80, 81, 82, 83, 85, 86, 87, 88, 89, 90, 92, 93, 94, 95, 96, 97, 99, 100, 101, 102, 103, 104, 106
OFFSET
1,2
LINKS
MATHEMATICA
Select[Range[106], GCD[Length[IntegerDigits[#, 2]], #]==1 &] (* Indranil Ghosh, Mar 08 2017 *)
PROG
(PARI) for(n=1, 106, if(gcd(#digits(n, 2), n)==1, print1(n, ", "))) \\ Indranil Ghosh, Mar 08 2017
(Python)
from fractions import gcd
i=1
j=1
while j<=100:
if gcd(len(bin(i)[2:]), 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
Name edited by Michel Marcus, Apr 30 2021
STATUS
approved