Overview: Calc-Tools Online Calculator offers a free platform for scientific calculations and mathematical tools. Its "Fermat's Little Theorem Solver" provides a comprehensive guide to this fundamental number theory concept. The tool explains the theorem's statement—how for a prime p and integer a, a^p ≡ a (mod p)—and its "little" distinction. It demonstrates practical applications, including primality testing and finding modular multiplicative inverses, while clarifying the critical condition that a and p must be coprime. Through concrete examples, it illustrates correct usage and common pitfalls, ensuring users can effectively apply the theorem in calculations.

Discover the power of a cornerstone of number theory. This guide will walk you through the essentials of Fermat's Little Theorem and demonstrate how our free scientific calculator can help you apply it. You will learn the theorem's core statement, its practical applications for primality testing and finding modular inverses, and a glimpse into its fascinating history.

Understanding Fermat's Little Theorem

Fermat's Little Theorem stands as a pillar in elementary number theory. It states that for any prime number p and any integer a, the value of a^p - a is always divisible by p. Expressed in modular arithmetic notation, this is:

a^p ≡ a (mod p)

A particularly useful corollary applies when a is not a multiple of p (i.e., a and p are coprime):

a^(p-1) ≡ 1 (mod p)

Practical Applications and Examples

Seeing the theorem in action clarifies its use. Let's examine a couple of concrete examples.

Example 1: Coprime Condition

Consider p = 7 and a = 15. Since 15 is not divisible by 7, the theorem assures us that 15^(7-1) ≡ 1 (mod 7). A quick calculation confirms that 15^6 - 1 = 11,390,624, which is indeed a multiple of 7.

Example 2: General Form

It's crucial to verify the theorem's preconditions. For p = 7 and a = 14, the numbers are not coprime. Therefore, the a^(p-1) ≡ 1 form does not apply. Instead, we use the general form a^p ≡ a (mod p). We find that 14^7 - 14 is divisible by 7, confirming the theorem's primary statement.

Why is it Called the "Little" Theorem?

The "little" designation distinguishes this theorem from Fermat's more famous Last Theorem. The Last Theorem, a legendary problem stating that no three positive integers satisfy x^n + y^n = z^n for n>2, remained unproven for centuries until Andrew Wiles' proof in 1995. In contrast, the Little Theorem, while profound, has a more straightforward application and proof, hence its modest nickname.

Finding a Modular Multiplicative Inverse

You can leverage Fermat's Little Theorem to compute the multiplicative inverse of an integer a modulo a prime p. Provided p is prime and a is not a multiple of p, the theorem states a^(p-1) ≡ 1 (mod p). This can be rewritten as:

a × a^(p-2) ≡ 1 (mod p)

Consequently, the multiplicative inverse of a modulo p is precisely a^(p-2). This provides a direct computational method using modular exponentiation.

Primality Testing with Fermat's Theorem

This theorem also offers a probabilistic test for primality. To check if a number p might be prime:

  1. Choose a random integer a between 2 and p-2.
  2. Compute a^(p-1) mod p.
  3. If the result is anything other than 1, p is definitively composite.
  4. If the result is 1, it suggests p could be prime, and the test should be repeated with different a values.
  5. After many repetitions without a definitive composite result, p is considered a probable prime.

Frequently Asked Questions

What is 19^11 mod 11 according to Fermat's Little Theorem?

The answer is 8. The theorem tells us 19^11 ≡ 19 (mod 11). Since 19 divided by 11 leaves a remainder of 8, the result is 8. This application is valid because 11 is a prime number, satisfying the theorem's requirement.

When was Fermat's Little Theorem first proven?

Pierre de Fermat first communicated the theorem in a 1640 letter to Frénicle de Bessy but did not include a proof. The first known published proof was by Leonhard Euler in 1736. Historical research later revealed that Gottfried Wilhelm Leibniz had also discovered a proof in an unpublished manuscript dated before 1683, predating Euler's work.