A relatively recent paper Alain Connes - Around Wilson's theorem introduced the function $$ S(n,x ) = \sum_{i=1}^n \sin^2\Bigl(\frac{(i-1)! x}{i}\Bigr). $$ In the same paper, he proved that the integer part of $S(n, \pi/2)$ represents the prime counting function $\pi(n)$.

Can we bound the sum $S(n,x)$, or at least get prime number theorem from $S(n, \pi/2)$?

History of the Theory of Numbers, Volume I Divisibility and Primality, Dover Publications 2005. $\endgroup$ – user142929 Aug 29 at 5:52