Wooden Floor

Algebra Level 4

m = 1 n log 2 m = 2002 , n = ? \large \sum_{m=1}^n \left \lfloor \log_2 m \right \rfloor = 2002 \qquad , \qquad n = \ ?


The answer is 313.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Bill Bell
Aug 13, 2015
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
from math import log, floor

m=0
total=0
while True:
    m+=1
    total+=floor(log(m,2))
    if total>=2002:
        print m, total
        break

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...