General formula.

Translate the text above into English, please retain the line breaks and format of the source text, and output the translation result directly.
14. First prove that for any non-negative integer $n, a_{n} \in[0,2]$ :
(1) When $n=0$, the conclusion holds.
(2) Assume that when $n=k(k$ is a non-negative integer $)$ the conclusion holds, i.e., $0 \leqslant a_{k} \leqslant 2$, then:
$$
0<\sqrt{a_{k}+2} \leqslant \sqrt{2+2}=2 \text {, i.e., } a_{k+1} \in[0,2] \text {. }
$$

From $(1)(2)$ we know: $a_{n} \in[0,2]$,
so we can let $a_{n}=2 \cos \theta_{n}\left(\theta_{n} \in\left[0, \frac{\pi}{2}\right]\right)$, then we have: $\left(2 \cos \theta_{n}, 1\right)^{2}=2 \cos \theta_{n}+2$ i.e., $\cos \theta_{n}=2 \cos ^{2} \theta_{n+1}-1=\cos 2 \theta_{n}, 1$, because $\sin \theta\left[0, \frac{\pi}{2}\right]$, so $\theta_{n+1}=\frac{1}{2} \theta_{n}$. From $a_{0}=0$ we know $\theta_{0}=\frac{\pi}{2}$, so $\theta_{n}=\frac{\pi}{2^{n+1}}$, so $a_{n}=2 \cos \frac{\pi}{2^{n}-1}$.