%I #24 Nov 07 2022 07:40:52
%S 0,5,9,10,17,18,20,33,34,36,39,40,49,65,66,68,69,72,78,80,98,105,129,
%T 130,132,135,136,138,144,156,160,169,196,199,209,210,229,257,258,260,
%U 263,264,270,272,276,277,288,291,297,312,313,320,338,359,365,392,395,398,418
%N Numbers m such that B(m^3) = 3*B(m), where B(m) is the binary weight of m (A000120).
%C 2*k is a term if and only if k is a term. - _Robert Israel_, Nov 06 2022
%H Robert Israel, <a href="/A212314/b212314.txt">Table of n, a(n) for n = 1..10000</a>
%F A000120(a(n)^3) = A000120(a(n)) * 3.
%p select(n -> convert(convert(n^3,base,2),`+`) = 3*convert(convert(n,base,2),`+`), [$0..1000]); # _Robert Israel_, Nov 06 2022
%o (Python)
%o import math
%o for n in range(10000):
%o c1 = c2 = 0
%o t = n
%o while t:
%o c1+=t&1
%o t>>=1
%o t = n*n*n
%o while t:
%o c2+=t&1
%o t>>=1
%o if c1*3==c2: print(str(n), end=',')
%o (Sage)
%o s = lambda n: sum((n^3).digits(2)) - 3*sum(n.digits(2))
%o [n for n in (0..418) if s(n)==0] # _Peter Luschny_, Oct 24 2013
%o (PARI) isok(m) = hammingweight(m^3) == 3*hammingweight(m); \\ _Michel Marcus_, Nov 06 2022
%Y Cf. A000120, A077436, A083567, A118655, A212315.
%Y Includes A136318.
%K nonn,base,easy
%O 1,2
%A _Alex Ratushnyak_, Oct 24 2013