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.

A381754 Numbers k such that k and 3*k have the same number of zeros in their binary expansions.

This page as a plain text file.
%I A381754 #30 Apr 07 2025 09:50:05
%S A381754 0,1,2,4,8,16,19,32,35,38,39,53,64,67,70,71,76,78,79,101,105,106,117,
%T A381754 128,131,134,135,140,142,143,152,156,158,159,197,201,202,209,210,212,
%U A381754 229,233,234,245,256,259,262,263,268,270,271,280,284,286,287,301,304
%N A381754 Numbers k such that k and 3*k have the same number of zeros in their binary expansions.
%C A381754 If n is in the sequence, so is 2n, hence the sequence is infinite. - _Charles R Greathouse IV_, Mar 06 2025
%C A381754 This sequence corresponds to the numbers m such that A381934(m) <= 3. - _Rémy Sigrist_, Mar 12 2025
%H A381754 Robert Israel, <a href="/A381754/b381754.txt">Table of n, a(n) for n = 1..10000</a>
%p A381754 filter:= proc(n) numboccur(0,convert(n,base,2)) = numboccur(0,convert(3*n,base,2)) end proc:
%p A381754 select(filter, [$0..400]); # _Robert Israel_, Apr 07 2025
%t A381754 Select[Range[0, 320], Equal @@ DigitCount[{#, 3*#}, 2, 0] &] (* _Amiram Eldar_, Mar 06 2025 *)
%o A381754 (Python) def ok(n): return bin(n).count('0') == bin(n * 3).count('0')
%o A381754 (PARI) nz(n) = if(n == 0, 1, 1+logint(n, 2) - hammingweight(n))
%o A381754 is(n)=nz(n)==nz(3*n) \\ _Charles R Greathouse IV_, Mar 06 2025
%Y A381754 Cf. A023416, A077459, A381934.
%K A381754 nonn,base,easy
%O A381754 1,3
%A A381754 _Barak Manos_, Mar 06 2025