There is an exact $n$th prime number formula from mathworld
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}$$
I tried to check it numerically but there is no correct answer :
s[j_] := -(Sum[(Floor[j/s] - Floor[(j - 1)/s]) - 2, {s, 1, j}]/j)
p[n_] := 1 + Sum[1 - Floor[Sum[1 + Floor[s[j]], {j, 2, k}]/n], {k, 1,
2*(Floor[n Log[n]] + 1)}]
p[30]
-1106
s[j_] := 2 (1 + Sum[Floor[(j - 1)/s] - Floor[j/s], {s, 1, Sqrt[j]}])/j
$\endgroup$