The unfortunate answer to your question is that, as of now, no. By this I mean there is no function we know of where if you enter in some number $n$, $f(n)$ would provide you with the $n^{th}$ prime number.

In fact, if we had such a function we could probably learn and solve a lot of things about the prime counting function (which you may find interesting), and by extension the Riemann Zeta Function.

Now there are smaller results that are similar to your question, such as the polynomial $$ n^2 + n + 41 $$ which generates a prime number for every $1\leq n \leq 39$, but these sorts of things would depend on what you were looking for.


Mathworld's article on Prime-Generating Polynomials is quite interesting.

https://mathworld.wolfram.com/Prime-GeneratingPolynomial.html

Here is the first paragraph:

Legendre showed that there is no rational algebraic function which always gives primes. In 1752, Goldbach showed that no polynomial with integer coefficients can give a prime for all integer values (Nagell 1951, p. 65; Hardy and Wright 1979, pp. 18 and 22).

However, there exists a polynomial in 10 variables with integer coefficients such that the set of primes equals the set of positive values of this polynomial obtained as the variables run through all nonnegative integers, although it is really a set of Diophantine equations in disguise (Ribenboim 1991). Jones, Sato, Wada, and Wiens have also found a polynomial of degree 25 in 26 variables whose positive values are exactly the prime numbers (Flannery and Flannery 2000, p. 51).