Fermat's Little Theorem Calculator

Form

Results

Fermat's Little Theorem

0

1

What is Fermat's Little Theorem?

Fermat’s little theorem simplifies powers modulo a prime.

2

How to Use This Calculator

  1. Enter or select a, p.
  2. Check the unit beside each measurement. For a percentage or rate, use the scale and time period stated in the form.
  3. Choose Calculate, then compare the output with the formula and example below. If you change a value or option, calculate again to update the result.
3

Formula Used

a^(p−1) ≡ 1 (mod p), when p is prime and p does not divide a
4

Variables Explained

InputWhat it means
aA value or coefficient in the formula above; keep the displayed position and sign.
pUse the measured or stated value for this item, with the unit or category shown beside the field.
5

Worked Example

For a = 2 and p = 7, 2^6 = 64 leaves remainder 1.

6

Why Use This Calculator?

Simplify a modular power when the prime-modulus assumptions apply.

7

Common Mistakes

    • The prime condition matters; the same conclusion does not hold for every composite modulus.
8

Frequently Asked Questions

Should I round numbers before calculating?

Keep the original input precision through the calculation and round the final answer to the precision you need. Rounding an intermediate result can change later steps.

Why can a manual calculation differ slightly?

Check the operation, units, signs and rounding first. Equivalent fractions or expressions can look different while representing the same value.

9

Sources & References