4.96 For a real number $x$, $[x]$ denotes the greatest integer not exceeding $x$. Find the positive integer $n$ such that $\left[\log _{2} 1\right]+\left[\log _{2} 2\right]+\left[\log _{2} 3\right]+\cdots+\left[\log _{2} n\right]=1994$.
[Solution] Let
$$
S n=\left[\log _{2} 1\right]+\left[\log _{2} 2\right]+\left[\log _{2} 3\right]+\cdots+\left[\log _{2} n\right] .
$$

Obviously, for non-negative integer $k$, there are $2^{k}$ positive integers
$$
2^{k}, 2^{k}+1,2^{k}+2, \cdots, 2^{k+1}-1
$$

such that when $x$ equals any of these $2^{k}$ positive integers, we have $\left[\log _{2} x\right]=k$. Therefore, for any positive integer $r$, we have
$$
\begin{aligned}
S_{2^{r}-1}= & 0+(1+1)+(2+2+2+2)+\cdots+ \\
& \underbrace{[(r-1)+(r-1)+\cdots+(r-1)]}_{2^{r-1}} .
\end{aligned}
$$

The right side of this expression has
$2^{r}-2^{1} \quad$ terms no less than 1;
$2^{r}-2^{2}$ terms no less than 2;
$2^{r}-2^{3} \quad$ terms no less than 3;
......
$2^{r}-2^{r-2}$ terms no less than $r-2$;
$2^{r}-2^{r-1} \quad$ terms no less than $r-1$.
Therefore,
$$
\begin{aligned}
S_{2^{r}-1} & =\left(2^{r}-2^{1}\right)+\left(2^{r}-2^{2}\right)+\cdots+\left(2^{r}-2^{r-2}\right)+\left(2^{r}-2^{r-1}\right) \\
& =(r-1) \cdot 2^{r}-\left(2^{r}-2\right) \\
& =(r-2) \cdot 2^{r}+2 .
\end{aligned}
$$

When $r=8$, from the above formula we get $S_{255}=15381994$.
It is clear that if $S_{n}=1994$, then $255<n<511$.
Thus we have
$$
1994=S_{n}=S_{255}+(n-255) \cdot 8
$$

which is $1994=8 n-502$
Solving for $n$ gives $n=312$.