Math Buddyv1.0
Check if a number is prime
Type a whole number. MathBuddy tests it for prime factors and shows the factorization step by step.
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 Calculator with fractions.
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
Problem
Is prime?
Answer
VerifiedThe answer is
Explanation
- Decide how far to test, so only the primes need testing.
- Rule out the small primesis odd, its digit sum is not a multiple of , and it does not end in or . and leave remainders.
- Try 13exactly.
- Concludehas the factors and , so it is not prime.
Example 2
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 powers
Example 3
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.
- MathBuddy can make mistakes. Double check important steps.
Related tasks
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.
1 math question to try today without signing in, 3 a day signed in, unlimited with Pro.
Ready to solve your next math problem?
Try one problem free in your browser. Create a free account for 3 math questions a day.
Last updated: · MathBuddy