Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If $[\cdot]$ denotes greatest integer function, then what is the value of natural number $n$ satisfying the equation $$[\log_21]+[\log_22]+[\log_23]+\dots[\log_2n]=1538 ?$$

My try:

Note that $$0+1\times2+2\times2^2+3\times2^3+4\times2^4+5\times2^5+6\times2^6+7\times2^7=1538$$

But the answer is $$n=\sum_{i=0}^72^i=255.$$

How is it derived?

share|cite|improve this question
Your first displayed line is a proof that the answer is correct. – André Nicolas Mar 8 '14 at 7:24
I think the OP means that, from what he wrote, the answer would come more naturally in the form $2^8-1$, the last value taken by $n$ in the sum. – alex Mar 8 '14 at 7:29
@Sush: You need the $2^7$ copies of numbers that give you a floor of $7$, so you need the numbers from $128$ to $255$. – André Nicolas Mar 8 '14 at 7:59
up vote 3 down vote accepted

For all $j$ such that $2^k\leq j<2^{k+1}$ for some integer $k$, we have $[\log j]=k$. Further note that there are exactly $2^k$ $j$s that $[\log[j]=k$ holds. Hence from $$0+1×2+2×2^2+3×2^3+4×2^4+5×2^5+6×2^6+7×2^7=1538$$, we can easily obtain $$\left([\log_21]\right)+\left([\log_22]+[\log_23]\right)+\cdots+\left([\log_2(2^7)+\cdots+\log_2(2^8-1)]\right)=1538$$

share|cite|improve this answer

I'm supposeing that the square brackets are the INT function.

The second equation supposes that all values are the same size. The correct form of it would be along the lines of the following. For eg 153, the first adds 7 to the total, while the second equation adds just 1. The equation as written below is a restatement of the equation above.


share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.