Number System

Primality Test

A pupil tries arranging counters into different rectangular arrays.

Primality Test definition

A primality test determines whether an integer greater than 1 is prime or composite, or provides evidence under a stated test model.

In Spanish
prueba de primalidad
Topic
Number theory

Primality Test in a picture

Primality Test diagramTo test 29 by trial division, check the primes up to √29.n = 29, √29 ≈ 5.39Only test prime candidates up to this boundTest 2, 3, and 5None divides 2929 is primeNo possible small prime divisor
To test 29 by trial division, check the primes up to √29.

How it works

For trial division, check prime divisors no greater than √n. If n = ab with both factors greater than 1, at least one factor is at most √n and has a prime divisor in that range. Faster methods use modular arithmetic, and some return a probable-prime result rather than a proof.

Worked examples

Is 49 prime?

No. 7 divides 49 and equals √49.

Which prime divisors must be tested for 37?

2, 3, and 5, because √37 is about 6.08.

Is 1 prime?

No. A prime is greater than 1 and has exactly two positive divisors.

Common mistake

Include the square-root boundary. A perfect square such as 49 has its smallest prime divisor exactly at that boundary.

Quick check

What bound suffices for trial division?

Show answer

√n.

Is every odd integer greater than 1 prime?

Show answer

No.

What does a nontrivial divisor prove?

Show answer

The number is composite.

Sources

Flashcard

Primality Test

Reveal the definition

A primality test determines whether an integer greater than 1 is prime or composite, or provides evidence under a stated test model.

Effortless Math. “Primality Test.” Math Dictionary.