// NUMBER THEORY · INTERMEDIATE
Prime FactorizationEvery whole number is a unique fingerprint of prime building blocks. Learn to split, factor, and reconstruct numbers one prime at a time.
Prerequisites: Prime numbers · Division · Exponents (optional)
// VISUALIZER
Split a number into its prime atoms
Trial division keeps dividing by the smallest possible prime until nothing is left. Enter a number and watch the factor tree grow.
Press PLAY to factor 84 step by step.
Prime factors found
Step
0 / 5
Current n
84
Factors Found
0
// MINI GAME
Factor Tree Builder
Click the prime buttons to divide the current number. Reach 1 before time runs out to build the tree and score big.
Growing the tree...
// FLOWCHART
Algorithm flow
Press PLAY to trace the algorithm through the flowchart.
// PSEUDOCODE
Trace the code
Press PLAY to step through the algorithm line by line.
// TUTORIAL QUIZZES
Test your mastery
From factor trees to GCD/LCM from factors, prove you can break any number into its primes.
// PRACTICE & ASSESS
Test your understanding
Now that you've learned the concept, put it into practice. Solve coding problems and take quizzes to reinforce what you've learned.
// REFERENCES
Sources & further reading
- [1]The Fundamental Theorem of ArithmeticEuclid — Book VII, Proposition 32 and Book IX, Proposition 14
- [2]Introduction to Algorithms (CLRS)T. H. Cormen et al. — Number-theoretic algorithms
- [3]Prime Numbers: A Computational PerspectiveRichard Crandall & Carl Pomerance
- [4]The Art of Computer Programming, Vol. 2Donald Knuth — Seminumerical Algorithms
// READY?
Solve systems of congruences
Next up: Chinese Remainder Theorem. Combine remainders from different moduli like a master cryptographer.