JEEOlympiad

Compute sum_{n=1}^{1023} floor(log_2 n), where floor is the greatest…

Question

Compute sum_{n=1}^{1023} floor(log_2 n), where floor is the greatest integer function and log_2 is the base-2 logarithm.

✓ Verified answer: 8194checked by our engine — not a guess

Step-by-step solution

For 2^k <= n <= 2^{k+1} - 1 we have floor(log_2 n) = k, and there are 2^k such integers.
For n from 1 to 1023 = 2^10 - 1, k runs from 0 to 9.
Sum = sum_{k=0}^{9} k*2^k. Using sum_{k=0}^{m} k*2^k = (m-1)2^{m+1} + 2 with m = 9:
= 8*2^10 + 2 = 8*1024 + 2 = 8192 + 2 = 8194.

Final answer8194

Stuck on a problem like this?

Paste any JEE or NEET question — verified working, a confidence %, and an honest “not sure” instead of a bluff.

Solve my doubt →

More Sequences Series solutions