cp's OEIS Frontend

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.

A077459 Numbers k such that k and 3*k have the same digital binary sum.

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Dec 01 2002

Keywords

Comments

Numbers k such that valuation(C(3*k,k),2) = valuation(C(2*k,k),2). - Benoit Cloitre, Mar 20 2004
From Robert Israel, Dec 13 2018: (Start)
If n is in the sequence, then so is 2*n.
If m and n are in the sequence and 2^k>3*n then 2^k*m+n is in the sequence. (End)
Contains all terms of A000225 except 1. - David A. Corneth, Dec 13 2018
Let's call "primitive" those a(n) not of the form 2^k*a(i) + a(j) with 2^k > 3*a(j), i > 1. The primitive terms not of the form 2^n-1 are (45, 89, 93, 109, 139, 151, 177, 217, 221, 237, ...) = (101101, 1011001, 1011101, 1101101, 10001011, 10010111, 10110001, 11011001, 11011101, 11101101, ...) in binary. Are all of them of the form x*2^k + 1 or 2^k + x where x = 2^m - 2^n - 1, m > n+1 (base-2 repunit with one "interior" digit 0, so that 3x has one bit 1 less than x)? - M. F. Hasler, Dec 13 2018

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.
		

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