OFFSET
1,2
LINKS
Andreas Boe, Table of n, a(n) for n = 1..10000
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
Andreas Boe, Jun 07 2014
STATUS
approved