Article · Wikipedia archive · Last revised Jul 15, 2026

Vantieghems theorem

In number theory, Vantieghem's theorem is a primality criterion. It states that a natural number n≥3 is prime if and only if

Last revised
Jul 15, 2026
Read time
≈ 1 min
Length
243 w
Citations
Source

In number theory, Vantieghem's theorem is a primality criterion. It states that a natural number n≥3 is prime if and only if

1 k n 1 ( 2 k 1 ) n mod ( 2 n 1 ) . {\displaystyle \prod _{1\leq k\leq n-1}\left(2^{k}-1\right)\equiv n\mod \left(2^{n}-1\right).}

Similarly, n is prime, if and only if the following congruence for polynomials in X holds:

1 k n 1 ( X k 1 ) n ( X n 1 ) / ( X 1 ) mod ( X n 1 ) {\displaystyle \prod _{1\leq k\leq n-1}\left(X^{k}-1\right)\equiv n-\left(X^{n}-1\right)/\left(X-1\right)\mod \left(X^{n}-1\right)}

or:

1 k n 1 ( X k 1 ) n mod ( X n 1 ) / ( X 1 ) . {\displaystyle \prod _{1\leq k\leq n-1}\left(X^{k}-1\right)\equiv n\mod \left(X^{n}-1\right)/\left(X-1\right).}

Example

Let n=7 forming the product 1*3*7*15*31*63 = 615195. 615195 = 7 mod 127 and so 7 is prime
Let n=9 forming the product 1*3*7*15*31*63*127*255 = 19923090075. 19923090075 = 301 mod 511 and so 9 is composite

References

References