A077459 Numbers k such that k and 3*k have the same digital binary sum.
0, 3, 6, 7, 12, 14, 15, 24, 28, 30, 31, 45, 48, 51, 56, 60, 62, 63, 75, 89, 90, 93, 96, 99, 102, 103, 109, 112, 115, 120, 124, 126, 127, 139, 150, 151, 155, 177, 178, 180, 185, 186, 189, 192, 195, 198, 199, 204, 206, 207, 217, 218, 221, 224, 227, 230, 231, 237
Offset: 1
Examples
51 binary representation is [1, 1, 0, 0, 1, 1] and 3*51=153 binary representation is [1, 0, 0, 1, 1, 0, 0, 1], both binary sum = 4, hence 51 is in the sequence.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Crossrefs
Cf. A000225.
Programs
-
Magma
[n: n in [0..300] | Valuation(Binomial(3*n, n), 2) eq Valuation(Binomial(2*n, n), 2)]; // Vincenzo Librandi, Dec 14 2018
-
Maple
filter:= n -> convert(convert(n,base,2),`+`)=convert(convert(3*n,base,2),`+`): select(filter, [$0..1000]); # Robert Israel, Dec 13 2018
-
Mathematica
digitSum[n_] := Total@IntegerDigits[n, 2]; Select[Range[0, 250], digitSum[#] == digitSum[3#] &] (* Amiram Eldar, Dec 13 2018 *)
-
PARI
is(n)=hammingweight(n)==hammingweight(3*n) \\ Charles R Greathouse IV, Mar 27 2013
Comments