Let $p$ denote a prime $> 3$.
Take any $\text{odd }n\geq3,\;n \in \mathbb{N}$.
How could one (dis)prove that:
$$n \log\left(\cos\left(\frac{\pi\,n!}{n^2}\right )\right ) \neq 0 \implies n = p$$
Although it doesn't seem practical for checking whether $x = p$, it is certainly nice lookin'!
The implication actually goes both ways. Clearly $$n\ln\left(\cos\dfrac{\pi n!}{n^2}\right)=0$$ if and only if $\cos\dfrac{\pi n!}{n^2}=1$. Now $\cos k\pi=1$ if and only if $k$ is an even integer, so $\cos\dfrac{\pi n!}{n^2}=1$ if and only if $\dfrac{n!}{n^2}=\dfrac{(n-1)!}n$ is an even integer.
If $n$ is prime, this fraction is not even an integer, so it’s certainly not an even integer, and
$$n\ln\left(\cos\dfrac{\pi n!}{n^2}\right)\ne 0\;.$$
If $n\ge 3$ is composite, then $\dfrac{(n-1)!}n$ is an integer, and the numerator has at least one even factor, $n-1$. Thus, the numerator is even, and the denominator is an odd divisor of that numerator, so the quotient is even, and
$$n\ln\left(\cos\dfrac{\pi n!}{n^2}\right)=0\;.$$