|
|
A243615
|
|
Numbers n whose digital sum equals the number of binary digits in its binary expansion.
|
|
5
|
|
|
1, 2, 13, 23, 33, 42, 51, 60, 70, 106, 115, 124, 134, 143, 152, 161, 170, 206, 215, 224, 233, 242, 251, 261, 270, 306, 315, 324, 333, 342, 351, 360, 405, 414, 423, 432, 441, 450, 504, 514, 523, 532, 541, 550, 604, 613, 622, 631, 640, 703, 712, 721, 730, 802, 811, 820
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
EXAMPLE
|
134 -> 1+3+4=8 134=10000110 -> Eight bits.
|
|
MATHEMATICA
|
Select[Range[10^3], Total@ IntegerDigits@ # == 1 + Floor@ Log2@ # &] (* Michael De Vlieger, Nov 05 2018 *)
Select[Range[1000], Total[IntegerDigits[#]]==IntegerLength[#, 2]&] (* Harvey P. Dale, May 30 2021 *)
|
|
PROG
|
(PARI) isok(n) = sumdigits(n) == #binary(n); \\ Michel Marcus, Jun 08 2014
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|