# Fermat primality test

The calculator tests an input number by a primality test based on Fermat's little theorem.

### This page exists due to the efforts of the following people:

#### Timur

Created: 2020-11-10 15:38:23, Last updated: 2021-02-24 15:33:04

This content is licensed under Creative Commons Attribution/Share-Alike License 3.0 (Unported). That means you may freely redistribute or modify this content under the same license conditions and must attribute the original author by placing a hyperlink from your site to this work https://planetcalc.com/8983/. Also, please do not modify any references to the original work (if any) contained in this content.

Using this calculator, you can find if an input number is Fermat pseudoprime. The calculator uses the Fermat primality test, based on Fermat's little theorem. If n is a prime number, and a is not divisible by n, then : $a^{n-1} \equiv 1 \pmod n$.

#### Fermat primality test

Can be prime

The file is very large. Browser slowdown may occur during loading and creation.

But, the test does not say an input number is prime or not. Even the result is 1. I.e., the converse is not true. if $a^{n-1} \equiv 1 \pmod n$ and a and n are coprime numbers does not mean n is a prime number.
E.g., the test on the number 29341 gives positive results using bases: 3; 5; 7; 11. However, this number is not prime. It is the composite Carmichael number: 13 x 37 x 61= 29341.

URL copied to clipboard

#### Similar calculators

PLANETCALC, Fermat primality test