#APL+WIN, 33 26 bytes
APL+WIN, 33 26 bytes
Prompts for vector of integers:
+/,((↑v)⍴2)⊤(1↓v)+0,⍳-/v←⎕
Try it online! Courtesy of Dalog Classic
Explanation:
v←⎕ prompt for input of a vector of two integers max first
(v←1↓v)+0,⍳-/ create a vector of integers from min to max
(↑v)⍴2 set max power of 2 to max
⊤ convert integers to a matrix of binaries
+/, convert matrix to a vector and sum