How does one prove that $(\log_{\,2}(n))^{2}$ is $O(n)$ ?
Using induction on $n$, one can easily show $n \lt 2^{n}$ for all integers $n \ge 1$ .
Since $\log_{\,2}$ is strictly increasing, it follows that $\log_{\,2}(n) \lt n$ for all integers $n \ge 1$, and hence $\log_{\,2}(n)$ is $O(n)$ .
I would like to (but am not yet able to) find the proof that $(\log_{\,2}(n))^{2}$ is $O(n)$ .
It appears that $\log_{\,2}(n) \lt \sqrt{n}$ for all $n \gt 16$ and if this could be proven it would follow that $(\log_{\,2}(n))^{2} \lt n$ for all $n \gt 16$ .
The Mathematica plot supporting this is …
Plot[{Log2[x], Sqrt[x]}, {x, 1, 30}, PlotLabels -> Placed[Automatic, Right]]
Mathematica shows that $y =\log_{\,2}(n)$ and $y = \sqrt{n}$ intersect at $n = 4$ and $n = 16$ …
NSolve[Log2[x] == Sqrt[x], x, Reals]
{{x -> 4.}, {x -> 16.}}
