Test
Interactive HTML content.
Interactive HTML content.
Interactive HTML content.
Interactive HTML content.
Interactive HTML content.

$O(n)$ does not mean fast. It means the running time grows at most linearly as $n$ grows. A $O(n)$ algorithm can lose to a $O(n^2)$ one on small inputs. Constants matter.
Interactive HTML content.
Interactive HTML content.
Interactive HTML content.
Suppose there were finitely many primes $p_1,\dots,p_n$. Consider $N=p_1 p_2 \cdots p_n + 1$. $N$ is divisible by none of them, so it has a prime factor not in the list. Contradiction.
Euler's identity Euler's identity, $e^{i\pi}+1=0$, ties together five fundamental constants in one line. It falls straight out of $e^{i\theta}=\cos\theta+i\sin\theta$ when you set $\theta=\pi$.
Interactive HTML content.
Binary search runs in $O(\log n)$ time, but the off-by-one bugs are famous. lo, hi = 0, len(a) while lo < hi: mid = (lo + hi) // 2 if a[mid] < target: lo = mid + 1 else: hi = mid The invariant: the an
Interactive HTML content.
Ignore air resistance and the path is a parabola. Horizontal: $x=v_0\cos\theta\,t$. Vertical: $y=v_0\sin\theta\,t-\tfrac{1}{2}gt^2$.
If $y=f(g(x))$ then $\frac{dy}{dx}=f'(g(x))\,g'(x)$ — derivatives multiply along the chain. Think of it as units cancelling: $\frac{dy}{du}\cdot\frac{du}{dx}$.