Britannica
Sources used in this answer
What does Fermat’s little theorem say about a prime number p and an integer a?
Created from Britannica articles
using AI.
AI can make mistakes, so verify using Britannica articles.
Pierre de Fermat
Fermat, portrait by Roland Lefèvre; in the Narbonne City Museums, France
Fermat’s little theorem (also referred to as Fermat’s lesser theorem) is a fundamental result in number theory first stated by the French mathematician Pierre de Fermat in 1640.12
The theorem states that for any prime number and any integer , the value is divisible by . In other words, divides exactly into .12
While Fermat did not leave behind a known proof for this theorem, it was later proved by Gottfried Wilhelm Leibniz and Leonhard Euler. The theorem provides a test that is necessary but not sufficient for determining whether a number is prime, as some composite numbers—known as pseudoprimes—can also satisfy the condition.12