login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A143071
A positive integer n is included if the number of 1's in the binary representation of n is a power of 2 (including being possibly 1).
5
1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 17, 18, 20, 23, 24, 27, 29, 30, 32, 33, 34, 36, 39, 40, 43, 45, 46, 48, 51, 53, 54, 57, 58, 60, 64, 65, 66, 68, 71, 72, 75, 77, 78, 80, 83, 85, 86, 89, 90, 92, 96, 99, 101, 102, 105, 106, 108, 113, 114, 116, 120, 128, 129, 130, 132, 135
OFFSET
1,2
LINKS
FORMULA
A209229(A000120(a(n))) = 1. - Reinhard Zumkeller, Sep 14 2014
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
For complement see A271499.
Sequence in context: A082415 A005236 A051250 * A305759 A143513 A062849
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Jul 22 2008
EXTENSIONS
More terms from Emeric Deutsch, Aug 13 2008
STATUS
approved