Terence Tao claims:
For instance, we have an exact formula for the $n^\text{th}$ square number – it is $n^2$ – but we do not have a (useful) exact formula for the $n^\text{th}$ prime number $p_n$!
“God may not play dice with the universe, but something strange is going on with the prime numbers.” (Paul Erdős, 1913–1996)
However there exist an exact formula for the nth prime
A double sum for the nth prime pn is $$p_n=1+\sum_{k=1}^{2(\lfloor n\ln n\rfloor+1)}\Biggl[1-\Biggl\lfloor\frac{\sum_{j=2}^k 1+\lfloor s(j)\rfloor}n\Biggr\rfloor\Biggr],\tag{13}$$ where $$s(j)\equiv-\frac{\sum_{s=1}^j \bigl(\bigl\lfloor\frac js\bigr\rfloor-\bigl\lfloor\frac{j-1}s\bigr\rfloor\bigr)-2}j\tag{14}$$
(See Prime formulas at MathWorld.) There exist even an exact formula for prime counting function $\pi (x)$. So why are mathematicians trying to prove the Riemann hypothesis to find a better estimate for $\pi(x)$ and $p_n$ when they have those exact formulas?
Usually when someone says "we have a formula for $f(x)$", they mean that we have a way to compute $f$ faster than it's direct definition (or by the definition, if that is fast enough).
For example, the function $f(x) = x^2$ can be computed by if $x$ is given in binary (or any radix) by the way you probably learned in elementary school. On the other hand, if you were asked to factor a large number, you would quickly learn that there is no known "formula", in other words, nothing is much faster than simply checking all numbers (the fastest known approaches are about as fast as checking the factors on a number with 1/3 the number of digits IIRC).