Teorema de Wilson ((p−1)! mod p)

= p−1 se p primo.
Created by
Renato Passos, Eng. de Software
Reviewed by
Renato Passos, Eng. de Software

Last updated: Apr 18, 2026

(p−1)! mod p
4,00

Formula

Wilson

About this calculator

The Wilson's Theorem Calculator is a useful tool for verifying if a number is prime or not. It uses the simple formula (p-1)! mod p, where p is the number to be verified. This formula is a direct consequence of Wilson's Theorem, which establishes a relationship between prime numbers and composite numbers.

To use this calculator, simply enter a number and select the option to calculate. The response will be 'p-1' if the number is prime and 'not prime' otherwise. It is worth noting that this calculator is not foolproof and cannot detect all composite numbers, but it is a useful tool for quickly verifying if a number is prime or not.

In that case, it is essential to use this calculator with caution and consider the cases in which it may fail. For instance, if the number is too large, the calculator may take a long time to calculate the response or may present errors due to excessive loading. Furthermore, it is essential to remember that the validity of a prime number does not depend solely on the calculator, and it is always a good idea to verify the response with other sources to ensure its accuracy.

In summary, the Wilson's Theorem Calculator is a useful and easy-to-use tool for verifying if a number is prime or not. Although it is not foolproof, it is a useful tool to help identify prime numbers and can be used in conjunction with other tools to ensure the accuracy of the responses.

Frequently asked questions

What is Wilson's Theorem?

Wilson's Theorem is a mathematical proposition that establishes a relationship between prime numbers and composite numbers. It was discovered by English mathematician John Wilson in 1770 and is one of the most important propositions in number theory.

How can I use the Wilson's Theorem Calculator?

Simply enter a number and select the option to calculate. The response will be 'p-1' if the number is prime and 'not prime' otherwise. Remember to use the calculator with caution and consider the cases in which it may fail.

Why is the Wilson's Theorem Calculator not foolproof?

The calculator is not foolproof because it cannot detect all composite numbers. Additionally, if the number is too large, the calculator may take a long time to calculate the response or may present errors due to excessive loading.

What should I do if the Wilson's Theorem Calculator does not give the correct answer?

If the calculator does not give the correct answer, it is always a good idea to verify the response with other sources to ensure its accuracy. Additionally, if you have any questions or need help, do not hesitate to contact us.

Other Teoria Numeros calculators