# [Pari/GP], 31 bytes

Saved one byte thanks to [Mr. Xcoder].

    a->b->sum(i=a,b,sumdigits(i,2))

[Try it online!][TIO-jkphzkfe]

[Pari/GP]: http://pari.math.u-bordeaux.fr/
[Mr. Xcoder]: https://codegolf.stackexchange.com/users/59487/mr-xcoder
[TIO-jkphzkfe]: https://tio.run/##K0gsytRNL/ifpmCr8D9R1y5J1664NFcj0zZRJ0kHyErJTM8sKdbI1DHS1PxfUJSZV6KRpmGiqWEO5AIA "Pari/GP – Try It Online"