Counting the number of sums of two powers of two below 2000

740 Views Asked by At

In this question, $x^y$ stands for $x$ raised to the power $y$. For example $2^3=8$ and $4^1.5=8$

Find the number of positive integers $n<2000$ which can be expressed as $n=2^m+2^n$ where $m$ and $n$ are integers (for example, $33=2^0+2^5$)

Answer: $65$

2

There are 2 best solutions below

1
On BEST ANSWER

One has $2^{10}=1024\lt2000\lt 2^{11}$ and $2^9=512$ so we have the possible forms $2^m+2^n$ as follows: $$2^{10}+2^k;\space k=0,1,\cdots,9\\2^9+2^k;\space k=0,1,\cdots,9\\2^8+2^k;\space k=0,1,\cdots,8\\2^7+2^k;\space k=0,1,\cdots,7\\2^6+2^k;\space k=0,1,\cdots,6\\2^5+2^k;\space k=0,1,\cdots,5\\2^3+2^k;\space k=0,1,\cdots,3\\2^2+2^k;\space k=0,1,2\\2+1,2+2\\2^0+2^0$$ Therefore we have $$10+\frac{10\cdot11}{2}=65\text { possible forms }$$

0
On

If we want all numbers $n \lt 2000$ and we do not reuse $n$ on both sides of the equation, we can just count them easily. We cannot allow $n$ or $m$ to be greater than $10$. By symmetry we can demand $n \ge m$. For $0 \le n \le 9$ we have $0 \le m \le n$, which gives $\frac 12 \cdot 10(10+1)=55$ cases. For $n=10$ we can only have $0 \le m \le 9$, which is another $10$ for $65$ total. If you think about binary numbers you should be able to convince yourself that all these are distinct.