OFFSET
1,2
COMMENTS
2*k is a term if and only if k is a term. - Robert Israel, Nov 06 2022
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
select(n -> convert(convert(n^3, base, 2), `+`) = 3*convert(convert(n, base, 2), `+`), [$0..1000]); # Robert Israel, Nov 06 2022
PROG
(Python)
import math
for n in range(10000):
c1 = c2 = 0
t = n
while t:
c1+=t&1
t>>=1
t = n*n*n
while t:
c2+=t&1
t>>=1
if c1*3==c2: print(str(n), end=', ')
(Sage)
s = lambda n: sum((n^3).digits(2)) - 3*sum(n.digits(2))
[n for n in (0..418) if s(n)==0] # Peter Luschny, Oct 24 2013
(PARI) isok(m) = hammingweight(m^3) == 3*hammingweight(m); \\ Michel Marcus, Nov 06 2022
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Alex Ratushnyak, Oct 24 2013
STATUS
approved