Is this a correct expression for a primality test using the Dirac delta?

58 Views Asked by At

$$\int_{1/2}^{n+1/2} \delta(1 - \cos(2 \pi x) + |sin(n \pi / x)|) \,dx$$

The idea here is $1- cos(2 \pi x)$ is zero at the integers, positive otherwise, and $|sin(n \pi / x)|$ is zero at real factors of $n$, positive otherwise. Adding these two yields a function that's zero at integer factors of $n$, but positive otherwise. Filtering this through $\delta(x)$ and integrating from a half to $n+1/2$ should count the number of whole factors of $n$. And of course if this equals two than $n$ is prime.

Update

As per comments, this is just a bit of curiosity as I'm not actually sure it's valid. Can this be considered a "smooth" analogue of the above?

$$\int_{1/2}^{n+1/2} \frac{1}{\sqrt{\pi} dx} \exp\left(-(1/dx)^2 \left(1 - \cos(2 \pi x) + \sqrt{sin(n \pi / x)^2+dx^2}\right)^2\right) \,dx$$