Pequeno Fermat (a^(p−1) mod p)

= 1 se p primo e mdc(a,p)=1.
Created by
Renato Passos, Eng. de Software
Reviewed by
Renato Passos, Eng. de Software

Last updated: Apr 18, 2026

a^(p−1) mod p
1,00

Formula

Fermat

About this calculator

The Fermat Theorem calculator is a useful tool for checking if a number is prime. It works based on the formula a^(p-1) mod p, which is a fundamental property of number theory.

This calculator is especially useful when you need to check the primality of a large number. Just enter the number and the modulus to get the Fermat Theorem result.

The Fermat Theorem is a powerful tool for cryptography and data security. It is also fundamental to understanding number theory and mathematics.

However, it is important to remember that the Fermat Theorem is not a proof of primality. To ensure the primality of a number, you need to use more advanced methods, such as the Miller-Rabin primality test.

Frequently asked questions

What is the Fermat Theorem?

The Fermat Theorem is a fundamental property of number theory that states a^(p-1) mod p = 1 if p is prime and gcd(a,p) = 1.

When to use the Fermat Theorem calculator?

Use the Fermat Theorem calculator when you need to check the primality of a large number or when you need to calculate the Fermat Theorem result for a given number.

What does the result of the Fermat Theorem calculator mean?

The result of the Fermat Theorem calculator indicates whether the number is prime or not. If the result is equal to 1, the number is likely prime.

Why is the Fermat Theorem not a proof of primality?

The Fermat Theorem is not a proof of primality because there may be composite numbers that satisfy the formula a^(p-1) mod p = 1. To ensure the primality of a number, you need to use more advanced methods.

Other Teoria Numeros calculators