OFFSET
1,2
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
34 in binary is 100010. This has 2 ones. And since 2 is a power of 2, 34 is included in the sequence.
MAPLE
a:=proc(n) local nn, n1: nn:=convert(n, base, 2): n1:=add(nn[j], j=1..nops(nn)): if 0 < n1 and type(log[2](n1), integer)=true then n else end if end proc: seq(a(n), n=1..140); # Emeric Deutsch, Aug 13 2008
MATHEMATICA
Select[Range[150], IntegerQ[Log2[DigitCount[#, 2, 1]]]&] (* Harvey P. Dale, Sep 26 2020 *)
PROG
(Haskell)
a143071 n = a143071_list !! (n-1)
a143071_list = filter ((== 1) . a209229 . a000120) [1..]
-- Reinhard Zumkeller, Sep 14 2014
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Jul 22 2008
EXTENSIONS
More terms from Emeric Deutsch, Aug 13 2008
STATUS
approved