HexMathv1.0.4
Prime number checker and calculator
This prime number checker tells you whether a whole number is prime and shows why. Type the number or scan it. HexMath tests the primes up to its square root, says whether the number is prime, and writes its prime factorization with powers, such as 360 = 2³ · 3² · 5, one division at a time.
Loading math input...
What this page covers
- Checking whether a whole number is prime by testing primes up to its square root.
- Prime factorization, written with powers, such as 360 = 2³ · 3² · 5.
- Listing or counting the primes below a number.
- Not covered here: tests for numbers with hundreds of digits. To reduce a fraction with these factors, use the fraction calculator.
How to enter the problem
- Type the question with the number, such as Is 221 prime? or Prime factorization of 360.
- Scan it. Fit the one problem in the frame.
- Choose a photo. Several problems in one photo are solved as a list.
- Then tap Solve.
Worked examples
Example 1: Find the smallest prime factor of 323.
Problem
Find the smallest prime factor of 323.
Answer
VerifiedThe answer is
Explanation
- Decide how far to test, so only the primes up to need checking: .
- Rule out 2, 3 and 5is odd; its digit sum is not a multiple of ; it does not end in or .
- Test 7, 11 and 13, remainder . , remainder . , remainder .
- Test 17exactly, so divides .
- Conclude. The smallest prime factor is , and is not prime.
Example 2: Write 360 as a product of primes.
Problem
Write as a product of primes.
Answer
VerifiedThe answer is
Explanation
- Divide by 2 while you can: three factors of .
- Divide by 3 while you can: two factors of .
- Stop at a primeis prime, so the factorization is complete.
- Write it with powersThree factors of , two factors of and one
Example 3: How many prime numbers are less than 50?
Problem
How many prime numbers are less than ?
Answer
VerifiedThe answer is
Explanation
- Choose the primes to sieve with, so crossing out multiples of and is enough.
- Cross out the multiplesFrom to , remove every multiple of except those primes themselves.
- List what is left.
- CountThere are numbers in the list.
Common mistakes
- Counting 1 as a prime. A prime has exactly two factors, 1 and itself, and 1 has only one.
- Calling a number prime because it is odd and looks unfamiliar: and .
- Stopping a factorization early, such as , which is , not .
- Testing every number up to n. Testing the primes up to the square root of n is enough.
Checks, assumptions and limits
- Multiply the factors back together: .
- Prime and composite apply to whole numbers greater than 1. The numbers 0 and 1 are neither.
- 2 is the only even prime, so any other even number is composite.
- Shortcuts before dividing: a number ending in 0, 2, 4, 6 or 8 is divisible by 2; if its digits add up to a multiple of 3, it is divisible by 3; if it ends in 0 or 5, it is divisible by 5.
- HexMath can make mistakes. Double check important steps.
Frequently asked questions
No. A prime has exactly two different factors, 1 and itself. The number 1 has only one factor, so it is neither prime nor composite.
If n = a × b and both a and b were larger than the square root of n, their product would be larger than n. So every factor pair has one member at or below the square root.
Choose a photo of the list. Several problems in one photo are solved as a list. You can also type each number as its own question.
Yes. Ask for the prime factors of a whole number. The steps divide by each prime in turn and the result is written with powers, such as 360 = 2³ · 3² · 5.
A whole number greater than 1 whose only factors are 1 and itself. 2, 3, 5, 7 and 11 are prime; 9 is not, because 9 = 3 · 3. 2 is the only even prime, because every other even number has 2 as a factor.
Divide it by each prime up to its square root. If none divides it exactly, it is prime. For 97 the square root is about 9.8, so test 2, 3, 5 and 7. None divides 97, so 97 is prime.
Related tasks
Ready to solve your next math problem?
Create a free account for 3 math questions a day in your browser. No card.
Last updated: · HexMath