Maximal subset $\{1,\dots,256\}$ with no pairs $x = 2y$ Let $A=\{1,\dots,256\}$. Find subset $A'\subset A$ with maximal elements s. t. there are no pairs $x=2y$.
My attempt is kind "including excluding formula": $256-128+64-\dots$
First take only odd numbers, the include half of even numbers (s. t. $4k$,  $k\in\mathbb N$) and so on.  

Some suggestions:


*

*These sets are called double-free sets, some more info can be found at MathWorld.

*It is not a coincidence that the range of your starting set is $\{1,\ldots,2^8\}$. 

*Let $a_n$ be the maximum size of such a set for range $\{1,\ldots,n\}$, then

*

*you can safely take all the odds,

*from the evens you cannot take these which are twice times some odd number,

*from the rest, i.e. $4k$ for some $k$, you want to take best pick, which is the same problem as $a_{\lfloor n/4 \rfloor}$.


*In other words,$$a_{n} = \left\lceil n/2\right\rceil + a_\left\lfloor n/4\right\rfloor,\quad \text{ that is, } \quad a_{4k} = 2k + a_k.$$

*With some manipulation, you can simplify it to $a_n = n - a_{\lfloor n/2 \rfloor}$, e.g. define $b_{n} = a_{n}-n+a_{\lfloor n/2 \rfloor}$ and by induction
\begin{align}
b_{1} &= 0 \\
b_{4k} &= a_{4k} - 4k + a_{2k} \\
       &= 2k+a_k - 4k + a_{2k} \\
       &= a_{2k}-2k+a_k \\
       &= b_{2k} = 0\\
b_{4k+1} &= 2k+1 + a_k - (4k+1) + a_{2k} = b_{2k} = 0 \\
b_{4k+2} &= 2k+1 + a_k - (4k+2) + a_{2k+1} = b_{2k+1} = 0\\
b_{4k+3} &= 2k+2 + a_k - (4k+3) + a_{2k+1} = b_{2k+1} = 0
\end{align}


I hope this helps $\ddot\smile$
