*This is accurate estimate!*

Perform a greedy algorithm. At start $B= \emptyset$. Now repeat: Take arbitrary element $a\in A$, delete it in $A$ and

- if it doesn't make AP in $B$ then put it in $B$ .
- if $a$ make AP with some $x,y\in B$ and
- if $a\ne {x+y\over 2}$ (it is not in the middle of $x,y$) then we refute it,
- if $a= {x+y\over 2}$ (it is in the middle of $x,y$) then we replace $x$ or $y$ with $a$ in $B$.

We finish when $A = \emptyset$. Now we do double counting between unordered pairs in $B$ and $B^C$.
Pair $\{x,y\}\subset B$ connect with $z\in B^C$ iff $x,y,z$ are in AP.

Every unordered pair in $B$ is connected with at most $1$ (and not $3$) elements in $B^C$. So, if $|B|=m$, then we have:

$$\binom{m}{2}\geq n-m\iff m\geq\frac{\sqrt{8n+1}+1}{2}$$