A255568 Numbers in whose binary representation there are six 1-bits more than there are nonleading 0-bits.
63, 191, 223, 239, 247, 251, 253, 254, 639, 703, 735, 751, 759, 763, 765, 766, 831, 863, 879, 887, 891, 893, 894, 927, 943, 951, 955, 957, 958, 975, 983, 987, 989, 990, 999, 1003, 1005, 1006, 1011, 1013, 1014, 1017, 1018, 1020, 2303, 2431, 2495, 2527, 2543, 2551, 2555
Offset: 1
Examples
63 ("111111" in binary) is included because there are 0 zero-bits and six 1-bits. 191 ("10111111" in binary) is included because there is 1 zero-bit and seven 1-bits, thus there are six 1-bits more than the number of 0-bits.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..16303
Crossrefs
Programs
-
PARI
is(n)=2*hammingweight(n)==6+#binary(n) \\ Charles R Greathouse IV, Dec 16 2015
-
PARI
for(b=3,6, for(n=2^(2*b-1),4^b-1, if(hammingweight(n)==3+b, print1(n", ")))) \\ Charles R Greathouse IV, Dec 16 2015
-
PARI
listBBitMembers(b)=if(b%2,return([])); my(u=List()); forvec(v=vector(3+b/2,i,[0,b-1]), listput(u, sum(i=1,#v,2^v[i])),2); Vec(u) \\ Charles R Greathouse IV, Dec 16 2015
-
Perl
use ntheory ":all"; my $bits = 0; for (1..1000) { my $o = hammingweight($); $bits++ if ($ & ($-1))==0; say if $o == 6+$bits-$o; } # _Dana Jacobsen, Dec 16 2015
Comments