Three, (50 points) Given a positive integer $n$. Find $\sum_{k=1}^{n}\left[\frac{n}{2^{k}}-\frac{1}{2}\right]$, where $[x]$ denotes the greatest integer not exceeding the real number $x$.

---

Please note that the format and line breaks have been preserved as requested.
$$
\text { Three, let } n=2^{m} a_{m}+2^{m-1} a_{m-1}+\cdots+2^{1} a_{1}+a_{0}
$$

where, $a_{m} \neq 0$.
At this point, $2^{m} \leqslant n<2^{m+1}$, so, $\left[\log _{2} n\right]=m$.
If $k \geqslant m+2$, then
$$
\frac{n}{2^{k}}-\frac{1}{2}<\frac{2^{m+1}}{2^{m+2}}-\frac{1}{2}=0 \text {, }
$$

at this time, $\left[\frac{n}{2^{k}}-\frac{1}{2}\right]=-1$.
If $k=m+1$, then
$$
\frac{n}{2^{k}}-\frac{1}{2}=\frac{n}{2^{m+1}}-\frac{1}{2} \in\left[0, \frac{1}{2}\right) \text {, }
$$

at this time, $\left[\frac{n}{2^{k}}-\frac{1}{2}\right]=0$.
If $k=m$, then
$$
\begin{array}{l}
{\left[\frac{n}{2^{k}}-\frac{1}{2}\right]=\left[\sum_{i=0}^{m} \frac{a_{m-t}}{2^{t}}-\frac{1}{2}\right]} \\
=\left[a_{m}+\frac{a_{m-1}}{2}-\frac{1}{2}\right]=a_{m-1} .
\end{array}
$$

If $k \leqslant m-1$, then,
$$
\begin{array}{l}
{\left[\frac{n}{2^{k}}-\frac{1}{2}\right]=\left[\sum_{t=0}^{m} 2^{m-k-t} a_{m-t}-\frac{1}{2}\right]} \\
=\sum_{t=k}^{m} 2^{t-k} a_{t}+a_{k-1}-1 .
\end{array}
$$

Then $\sum_{k=1}^{\left[\log _{2} n\right]}\left[\frac{n}{2^{k}}-\frac{1}{2}\right]=\sum_{k=1}^{m}\left[\frac{n}{2^{k}}-\frac{1}{2}\right]$
$$
\begin{array}{l}
=\sum_{k=1}^{m-1}\left[\frac{n}{2^{k}}-\frac{1}{2}\right]+a_{m-1} \\
=a_{m-1}+\sum_{k=1}^{m-1}\left(\sum_{t=k}^{m} 2^{t-k} a_{t}+a_{k-1}-1\right) \\
=a_{m-1}-a_{m}+\sum_{t=1}^{m} \sum_{k=1}^{t} 2^{t-k} a_{t}+\sum_{k=1}^{m-1} a_{k-1}-\sum_{k=1}^{m-1} 1 \\
=a_{m}\left(2^{m}-2\right)+\sum_{t=1}^{m-1}\left(2^{t}-1\right) a_{t}+\sum_{k=1}^{m} a_{k-1}-(m-1) \\
=\sum_{t=0}^{m} 2^{t} a_{t}-m-1=n-m-1 .
\end{array}
$$

Therefore, $\sum_{k=1}^{n}\left[\frac{n}{2^{k}}-\frac{1}{2}\right]$
$$
\begin{array}{l}
=\sum_{k=1}^{m}\left[\frac{n}{2^{k}}-\frac{1}{2}\right]+\left[\frac{n}{2^{m+1}}-\frac{1}{2}\right]+\sum_{k=m+2}^{n}\left[\frac{n}{2^{k}}-\frac{1}{2}\right] \\
=(n-m-1)+0+\sum_{k=m+2}^{n}(-1) \\
=(n-m-1)-(n-m-1)=0 .
\end{array}
$$