# Floor function of powers of $2$

Is there any way to know the exact value of

$$\left(\left\lfloor 2^{\frac{n}{2}} \right\rfloor\right)^2$$

for $n$ an integer $n>0$?

When $n$ is even, the solution is trivial, since we do not have to face any fractional part. On the other hand, for $n$ an odd number, it seems difficult to get the exact value.

We could try to get an aporoximation, but using $\lfloor x \rfloor = x + O(1)$ gives a pretty inaccurate result.

Any idea?

Edit: Would it be possible to get it if we knew the value of $$\left(\left\lfloor 2^{\frac{n}{2}-1} \right\rfloor\right)^2$$

? (A recursive fomula)

• This is just the greatest perfect square less than or equal to $2^n$. For instance, $3\to4$, $5\to25$, $6\to64$. There's not really a closed form for it other than what you have written. – Grant B. Apr 16 '17 at 0:18
• This is sequence $A065732$ in $OEIS$. Nothing more than what Grant B. Commented. – Claude Leibovici Apr 16 '17 at 4:42
• The main idea behind my "Edit" was trying to establish a recursive formula – user3141592 Apr 16 '17 at 19:35
• If it were possible to obtain a closed form expression for all $n$, then, by restricting to odd values $n$, we could obtain a closed form expression for the values of OEIS A084188 - This would mean that we could derive a closed expression for the $n^{th}$ digit in the binary representation of $\sqrt{2}$, which I don't think is possible given that it is irrational. – Paul Aljabar Apr 16 '17 at 19:40
• @PaulAljabar.Maybe this helps:community.wolfram.com/web/community/groups/-/m/t/1063480 – Mariusz Iwaniuk Apr 17 '17 at 6:02

Using identity: $$\lfloor x\rfloor =x-\frac{1}{2}+\frac{\sum _{k=1}^{\infty } \frac{\sin (2 k \pi x)}{k}}{\pi }$$
Solve sum ,substitute x=2^(n/2) and raise to the power 2 we have:
$$\left\lfloor 2^{n/2}\right\rfloor ^2=\frac{\left(\left(-1+2^{1+\frac{n}{2}}\right) \pi -i \log \left(1-e^{-i 2^{1+\frac{n}{2}} \pi }\right)+i \log \left(1-e^{i 2^{1+\frac{n}{2}} \pi }\right)\right)^2}{4 \pi ^2} = 1/4\,{\frac { \left( {2}^{1+n/2}\pi-2\,{\rm arccot} \left(\cot \left( \pi\,{2}^{n/2} \right) \right) \right) ^{2}}{{\pi}^{2}}}$$ and: $$\left\lfloor 2^{\frac{n}{2}-1}\right\rfloor ^2=\frac{\left(\left(-1+2^{n/2}\right) \pi -i \log \left(1-e^{-i 2^{n/2} \pi }\right)+i \log \left(1-e^{i 2^{n/2} \pi }\right)\right)^2}{4 \pi ^2} = 1/4\,{\frac {1}{{\pi}^{2}} \left( \pi\,{2}^{n/2}-\pi-2\,\arctan \left( {\frac {\sin \left( \pi\,{2}^{n/2} \right) }{-1+\cos \left( \pi\,{2}^{n/2} \right) }} \right) \right) ^{2}}$$