# Wanted to Know if this is a Valid Test for Prime Numbers

Is this a valid test for prime numbers?

$$\prod_{k=2}^{\lceil \sqrt{n} \rceil} \sin(\pi n/k) \neq 0 \quad \text{if } n \text{ is prime}$$

It uses a product of sines to test whether a number is divisible by an integer, if it is the product is zero, if not the number must be prime.

• If you put in a link to the image, a higher-rep user could edit the question so that the picture shows. – Omnomnomnom Apr 24 '17 at 0:25
• @Omnomnomnom Oops, I didn't mean to over write that... – John Doe Apr 24 '17 at 0:30
• Actually, its good, thanks :) – Jack Apr 24 '17 at 0:31
• well, I thought I would edit too, put it back to @Omnomnomnom, except changed floor to ceiling, as this is what the picture suggests (and I don't know which would be correct). – Mirko Apr 24 '17 at 0:32
• Well, I'm glad everything is in order. For future reference, here's a quick guide to mathematical typesetting on this site. – Omnomnomnom Apr 24 '17 at 0:34

Hint: there is a formula for primes based on sines, probably the theoretical base of yours is another way of writing it. It is based on Wilson's theorem:

$\displaystyle f(j)=\frac{\sin^2\left(\pi\frac{(j-1)!^2}{j}\right)}{\sin^2\left(\frac{\pi}{j}\right)} \cdot j$

So if you run a loop it should provide the list of primes and $0$'s as follows:

$[1,2,3,4,5,6,7,8,9,10,11...] \to [0,2,3,0,5,0,7,0,0,0,11...]$

• @Jack just in case: have you tested your formula with a programming language? does it hold for big $n$? – iadvd Apr 24 '17 at 2:46