Prime Number Formula Explained, With Examples

Updated 5 Oct 2026 in Math & Geometry

Every prime number result comes from one formula. Once you understand what goes into it, you can sanity-check any figure you are given, whether by an employer, a bank, a teacher or another website.

The formula

Test divisors up to √n.

What each input means

Example

For example, with these inputs:

the calculator returns:

How the result changes

The table keeps the other inputs at their example values and changes whole number.

Whole numberResult
9797 is a prime number
48.548 is not prime (divisible by 2)
72.7572 is not prime (divisible by 2)
121121 is not prime (divisible by 11)
146146 is not prime (divisible by 2)

Why it matters

These calculations come up in school, at work and in daily life, from PSLE and O-Level practice to measuring a room for new flooring. Doing them by hand builds understanding, and a calculator lets you check the answer instantly.

Calculators are best used to check working rather than replace it, especially for exams where method marks count. Work the problem by hand first, then confirm with the calculator.

Rounding is a common source of small errors. Keep full precision during intermediate steps and round only the final answer to the number of decimal places or significant figures the question asks for.

Each formula has assumptions built in. Area formulas assume flat shapes, volume formulas assume regular solids and statistical measures assume the data you enter is the data you want to describe. Knowing the assumptions helps you pick the right tool.

Related calculations

Use the Prime Number Checker to plug in your own numbers.

Run your own numbers: Prime Number Checker

Related guides