SOLVETUTORMATH SOLVER

Instrument MI-01-452 · Mathematics

Prime Factorization Calculator

A claimed factorization needs two checks. Enter a number and two claimed prime factors, and this sheet verifies both.

Instrument MI-01-452
Sheet 1 OF 1
Rev A
Verified
Type 05 — Algebra SER. 2026-01452

Product test (0 = p×q equals n)

0.00000000

product test = n − p×q

1.00000000 Primality test for p (1 = passes Fermat test)
1.00000000 Primality test for q (1 = passes Fermat test)
The working Every figure verified twice
  1. productTest = 15 − 3·5 = 0.00000000
  2. primalityP = 2^(3 − 1) mod 3 = 1.00000000
  3. primalityQ = 2^(5 − 1) mod 5 = 1.00000000
Worksheet log
  1. No entries yet — change an input to log a scenario.

How this instrument works

Verifying that a number equals the product of two claimed prime factors takes two separate checks: does the product actually reproduce the original number, and is each claimed factor genuinely prime? Getting either check wrong invalidates the whole claim — a correct product with a non-prime 'factor' isn't a genuine PRIME factorization at all, and a wrong product means the numbers don't even multiply out correctly in the first place.

The primality check reuses this site's own Prime Number page's method directly: Fermat's Little Theorem, testing whether 2 raised to one less than the candidate, taken modulo the candidate itself, comes back to exactly 1 — a fast, reliable primality test for the small primes this page's examples use.

This page checks a SPECIFIC claimed factorization rather than searching for one from scratch, since the DSL underlying this site's calculators has no way to try every possible divisor of a number in sequence — but verifying a given claim, the two checks this page performs, needs no such search at all.

n=?pq,2x1modx=?1n \stackrel{?}{=} pq, \quad 2^{x-1} \bmod x \stackrel{?}{=} 1
n — the number being factored; p, q — the two claimed prime factors; product test — 0 confirms the product matches; primality tests — 1 confirms each factor passes the Fermat test.
  • Enter the number being factored into the n field.
  • Enter the two claimed prime factors into the p and q fields.
  • Read Product test: 0 confirms p×q equals n exactly.
  • Read Primality test for p and q: 1 confirms each one passes the Fermat primality test.

Worked example — verifying 15 = 3 × 5

For 15, claimed to factor as 3×5: the product test comes out to 15−15=0, confirming the product matches. Both 3 and 5 pass the Fermat primality test with a result of 1, confirming they're genuinely prime — together, both checks confirm 15's prime factorization really is 3×5.

For 21, claimed to factor as 3×7: the product test is 21−21=0, and both 3 and 7 pass as prime. Testing 20 against a claimed factorization of 3×5 instead: the product test comes out to 20−15=5, nonzero — 3×5=15 does NOT equal 20, so this particular claim is wrong, even though 3 and 5 are each still individually prime.

Questions

What two things does verifying a prime factorization require?

Confirming the claimed factors actually multiply back to the original number, and separately confirming each claimed factor is genuinely prime — both checks must pass together for a claim to be a valid prime factorization.

How does the primality test work?

It applies Fermat's Little Theorem, the same method this site's Prime Number page uses: raising 2 to one less than the candidate and taking that result modulo the candidate itself — a result of 1 is strong evidence (though not an absolute guarantee) of primality.

Why does this page verify a claim instead of searching for the factors itself?

Finding prime factors from scratch needs testing a sequence of candidate divisors, which this site's calculator engine has no built-in way to do; checking a SPECIFIC given claim, by contrast, needs only the two direct tests this page performs.

What does a nonzero product test mean?

That the claimed factors don't actually multiply back to the original number — the factorization claim is simply wrong, regardless of whether the individual claimed factors happen to be prime.

Can the primality test ever be wrong?

Extremely rarely — certain composite numbers, called Fermat pseudoprimes, can pass this specific test despite not being prime, though this is uncommon for the small numbers this page's examples use.

References