Let $n \ge 1$ be an odd natural number. Define $$f(n)=\min \{\,\, |k| \,\,\, | \, k+2^n \,\,\,\text{is a square}\,\,,k \in \mathbb{Z}\}.$$
That is $f(n)$ measures how close is the power $2^n$ to a perfect square.
I guess that this notion was studied somewhere, but I couldn't find it naively on google.
Question: (a bit soft)
Does this function has a known name in the literature? Has it been studied somewhere? Is there a closed form formula for it, or at least some nice lower bounds on its values?
Ineffectively, one can show that, given $\epsilon > 0$, there exists a positive constant $c(\epsilon)$ such that $$ f(n) \geq c(\epsilon) \, 2^{(1/2-\epsilon)n}. $$ This follows from the $p$-adic version of Roth's theorem, proved by Ridout, and represents the true state of affairs. I suspect that making this effective would be very hard and anything resembling a closed form is too much to hope for.
In terms of explicit lower bounds, one can prove that $$ f(n) > 2^{0.26n}, $$ unless $n \in \{ 3, 15 \}$. This can be found in an old paper of Bauer et al; the proof uses Pade approximation to the binomial function. It is unlikely that one can get much of a bound via elementary methods.