To count the maximum number of integers from $1\dots 2^n$ s.t. none of them is twice the other we can group them by their biggest odd divisor, i.e. represent each $m$ as $m=2^k (2c+1)$, so we can take at most $$\lfloor \frac{\log_2 \lfloor \frac{2^n}{2c+1} \rfloor + 1}{2} \rfloor$$ of them. The log part of this expression is the biggest $k$ such that $2^k(2c+1)$ is not bigger than $2^n$, and then floor of division by $2$ is used to count how many integers can be taken from a group (we can take every second starting from the first one). So to answer the question of how many integers we can take so that none of them is twice the other we just need to sum the expression over $c$. However, I fail to see where $\lfloor (2^n-2)/3 \rfloor$ comes from, which is supposed to be at least $1$ bigger than the sum. So my question is about how we can relate the sum of the expression above to $\lfloor (2^n-2)/3 \rfloor$ or how we can derive that $\lfloor (2^n-2)/3 \rfloor$ integers are sufficient using other methods.
Any help is appreciated.
Update. I found a way to count it it the other way. As I said, we need to take every second element in each group, so we need to take every $1$-st, $3$-rd, $5$-th, ..., and so on. Every $1$-st element is every odd integer, every $3$-rd element is every integer $2^2(2c+1)$. We can count each $(2l+1)$-th element as $2^n/2^{2l}-2^n/2^{2l+1}$ (which is the number of multiples of power of two minus number of multiples of the next power of two). Therefore, the maximum number of integers we can keep so that there is no $a=2b$ can be expressed as a sum $$2^n \sum_{k=0}^n \frac{(-1)^{k}}{2^k} = 2^n \left[\frac{1}{3}\left((-1)^n+2^{n+1}\right)\right]$$.
To get the expression from the question we need to add one to this expression (so that there is $a=2b$ by pigeonhole) and subtract from $2^n$: $$2^n- 2^n \left[\frac{1}{3}\left((-1)^n+2^{n+1}\right)\right]-1=\frac{1}{3}\left(2^n+(-1)^{n+1}-3\right).$$
We can prove using casework on even and odd $n$ that the final expression is equivalent to $\lfloor (2^n-2)/3 \rfloor$ we have in the question.
Right now I know how to derive what I wanted, but my solution is heavily algebraic, and I feel like I started from the wrong direction: I tried to compute how many numbers we can keep so that there is no $a=2b$, but the question asks how many we can remove so that there is still $a=2b$. I mean the latter question can still be solved algebraically by changing sums a bit, but I'd like to find a simpler solution if there is any, one that doesn't require this summing argument. In my original question I asked for two possible directions to answer, and I worked myself through the first one, so I'll keep this as a question, not an answer in case there is an easier direct explanation to derive $\lfloor (2^n-2)/3 \rfloor$.
(I'm almost certain that this is a dupe, but can't seem to find one. If anyone can, please feel free to close.)
Fix $n$. Suppose we have removed enough pairs such that there's no $a = 2b$.
Corollary: If we remove strictly fewer than $ \lfloor \frac{ 2^n + 1 } { 3 } \rfloor $ integers (IE at most $\lfloor \frac{ 2^n -2 } { 3 } \rfloor$ integers), then there exists a $c$ such that we remove fewer than $c_n$ integers, hence we can find such an $ a = 2b$.