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”).

Numbers whose sum of digits equals the number of bits in its binary expansion. No zeros allowed in the digital expansion.
2

%I #14 May 09 2021 19:00:19

%S 1,2,13,23,33,42,51,115,124,134,143,152,161,215,224,233,242,251,261,

%T 315,324,333,342,351,414,423,432,441,514,523,532,541,613,622,631,712,

%U 721,811,1118,1127,1136,1145,1154,1163,1172,1181,1217,1226,1235,1244

%N Numbers whose sum of digits equals the number of bits in its binary expansion. No zeros allowed in the digital expansion.

%C This sequence is a subsequence of A243615.

%H Andreas Boe, <a href="/A243617/b243617.txt">Table of n, a(n) for n = 1..10000</a>

%e 42 -> 4+2=6, 42=101010_2 -> 6 bits.

%o (PARI) isok(n) = (sumdigits(n) == #binary(n)) && (vecmin(digits(n)) != 0); \\ _Michel Marcus_, Jun 08 2014

%Y Cf. A243615 (same principle, but zeros allowed in digital expansion).

%K nonn,base

%O 1,2

%A _Andreas Boe_, Jun 07 2014