This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A161155 #18 Jun 28 2025 11:16:21 %S A161155 1,5,9,11,13,17,19,23,27,29,35,37,41,43,47,49,53,59,61,67,71,73,79,83, %T A161155 85,87,89,93,95,97,101,103,107,109,113,117,121,125,131,133,135,137, %U A161155 139,141,143,147,149,151,153,157,161,163,165,167,169,173,175,177,179,181 %N A161155 Positive integers n such that {the number of (non-leading) 0's in the binary representation of n} is coprime to n, {the number of 1's in the binary representation of n} is coprime to n and {the number of digits in the binary representation of n} is coprime to n. %C A161155 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. %H A161155 Indranil Ghosh, <a href="/A161155/b161155.txt">Table of n, a(n) for n = 1..1000</a> %t A161155 Select[Range[181], GCD[DigitCount[#,2,0] , #]==1 && GCD[DigitCount[#,2,1],#]==1 && GCD[Length[IntegerDigits[#,2]],#]==1 &] (* _Indranil Ghosh_, Mar 08 2017 *) %o A161155 (PARI) b0(n) = if(n<1, 0, b0(n\2) + 1 - n%2); %o A161155 b1(n) = if(n<1, 0, b1(n\2) + n%2); %o A161155 for (n=1, 181, if(gcd(b0(n), n) == 1 && gcd(b1(n), n) == 1 && gcd(#digits(n, 2), n) == 1, print1(n", "))) \\ _Indranil Ghosh_, Mar 08 2017 %o A161155 (Python) %o A161155 from math import gcd %o A161155 i=j=1 %o A161155 while j<=100: %o A161155 if gcd(bin(i)[2:].count("0"),i)==1 and gcd(bin(i)[2:].count("1"),i)==1 and gcd(len(bin(i)[2:]),i)==1: %o A161155 print(j, i) %o A161155 j+=1 %o A161155 i+=1 # _Indranil Ghosh_, Mar 08 2017 %Y A161155 Cf. A094387, A161152, A161153, A161154, A161156. %K A161155 base,nonn %O A161155 1,2 %A A161155 _Leroy Quet_, Jun 03 2009 %E A161155 Extended by _Ray Chandler_, Jun 11 2009