The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A161152 Positive integers n such that {the number of (non-leading) 0's in the binary representation of n} is coprime to n. 5
1, 2, 5, 6, 8, 9, 11, 13, 14, 17, 19, 20, 21, 23, 25, 27, 29, 30, 32, 33, 35, 37, 38, 39, 41, 43, 44, 45, 47, 49, 50, 51, 52, 53, 55, 56, 57, 59, 61, 62, 66, 67, 68, 69, 71, 72, 73, 77, 79, 81, 83, 85, 86, 87, 89, 91, 92, 93, 95, 96, 97, 101, 103, 106, 107, 109, 111, 113, 115 (list; graph; refs; listen; history; text; internal format)
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
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
Sequence in context: A157850 A049636 A045573 * A261905 A340602 A350945
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Jun 03 2009
EXTENSIONS
Extended by Ray Chandler, Jun 11 2009
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 12 18:22 EDT 2024. Contains 372494 sequences. (Running on oeis4.)