For positive integer $n$, define the set $A_n=\{0,1,\ldots,n\}$. What is the size of the largest subset of $A_n$ such that the sum of any two (not necessarily distinct) elements in it is not a power of $2$?
So, a power of $2$ can never be chosen. For $n=3,4,5$, the set $\{0,3\}$ is the best possible, and for $n=6,7$ we can choose $\{0,3,6\}$ and $\{0,3,6,7\}$, respectively.
This is a partial solution. Nevertheless, I hope it helps somehow.
Consider the same problem, but now $A_n=\{1,\ldots,n\}$. We always can add $0$ at the end.
I have a solution when $n$ is itself a power of two, say $n=2^k$. A set in this case is $$2^{k-1}+1,2^{k-1}+2,\ldots,2^k-1$$
The sum of two of these numbers is $\ge2(2^{k-1}+1)=2^k+2>2^k$ and $\le 2(2^k-1)=2^{k+1}-2<2^{k+1}$. So never is a power of two. But in this set there are $$2^{k-1}-1$$ numbers. Let's show that this is the greatest possible size.
If there is a set with $2^{k.-1}$ elements, then at least one of them, say $a_1$, is lesser than $2^{k-1}$. But then, $2^k-a_1$ can not be in the set. Therefore, there must be another element $a_2$ lesser than $2^{k-1}$, etc.
We conclude that every element is lesser than $2^{k-1}$, a contradiction.
Now we can add the number $0$, so the solution is $2^{k-1}$.