Formula for the nth prime number. I need to see how to make a certain development, and did not find any reference to do, the only quote I found, so is the following, I know (have shown)
$$ \pi(m)=-1+\sum_{j=1}^{m} F(j) $$ with $$F(j)=\left[ \cos^2 \pi\frac{(j-1)!+1}{j}\right]$$ and also I have to 
$$ \pi(m)=\sum_{j=1}^{m} H(j) $$ for all $ m\ge2 $, at where $$ H(j)=\dfrac{\sin^2\pi\dfrac{((j-1)!)^2}{j}}{\sin^2\dfrac{\pi}{j}} $$
this second part also fails to prove if someone wants to put some demonstration would be very happy, but the focus is the same demonstration that the nth prime number is given by
$$ p_n=1+\sum_{m=1}^{2^n} \left[\left(\frac{n}{\sum_{j=1}^{m} F(j)} \right )^{1/n} \right ]$$
 A: The key fact in the formulae above is Wilson's theorem:

If $n$ is prime, then $(n-1)!+1$ is divisible by $n$.

And the slightly more obvious:

If $n$ is composite and $n\neq4,$ then $(n-1)!$ is divisible by $n$.

Let's state upfront, though: These formula are essentially "nonsense," in that they add zero knowledge beyond our knowledge from Wilson's theorem, and are certainly not computationally useful.
Formula 1
$$\theta_j = \pi\frac{(j-1)!+1}{j}$$
will be a multiple of $\pi$ if $j$ is prime, and something else if $j$ is not prime. So $\cos^2\theta_j = 1$ if $j$ is prime and otherwise it is some value in $[0,1)$ so
$$\left\lfloor \cos^2\theta_j \right\rfloor = \begin{cases}1&\text{if $j$ is prime or $j=1$}\\
0&\text{if $j$ composite}
\end{cases}$$
The case $j=1$ is why there is a $-1$ added to the sum above.
Formula 2
The second case has $H(j)=F(j)$ for $j>1$. It's not actually defined when $j=1$, so you'd have to deal with that to fix it.
If $j$ is composite, then $\pi\frac{(j-1)!^2}{j}$ is a multiple of $\pi$, so the numerator is zero, so $H(j)=0$.
When $j$ is prime, then $\pi\frac{(j-1)!^2}{j} = \frac{\pi}{j}+M\pi$ for some integer $M$, so the sine of this angle is $\pm\sin \frac{\pi}{j}$, and therefore the square of the quotient is $1$.
Formula 3
The last formula can be rewritten as:
$$p_n=1+\sum_{m=1}^{2^n} \left\lfloor\left(\frac{n}{1+\pi(m)} \right )^{1/n} \right\rfloor$$
But it is easy to show that $n^{1/n}<2$ for all $n$, and thus
$$\left\lfloor\left(\frac{n}{1+\pi(m)} \right )^{1/n}\right\rfloor=\begin{cases}1&\text{if }\pi(m)<n\\
0&\text{otherwise}
\end{cases}$$
Since the first $n$ primes are known to be less than $2^n$, this sum counts all $m$ with $\pi(m)<n$, which is is $p_n-1$. Adding $1$ gives $p_n$.
