Prime Factorization Formulas
Master prime factorization with comprehensive formulas and algorithms. From the fundamental theorem of arithmetic to advanced factorization techniques.
1Fundamental Theorem of Arithmetic
The cornerstone of prime factorization - every integer greater than 1 has a unique prime factorization.
Key Properties:
- • Uniqueness: Only one way to factorize (up to order)
- • Completeness: Every integer has this representation
- • Multiplicativity: Basis for GCD and LCM calculations
Example:
2Trial Division Algorithm
The most basic and intuitive method for finding prime factors by systematically testing divisibility.
Algorithm Steps:
Example: Factor 84
3Optimized Trial Division
Enhanced version that skips composite numbers and uses mathematical optimizations.
Optimization 1: Skip Even Numbers
After testing 2, only test odd numbers:
This reduces testing by ~50%
Optimization 2: √n Boundary
If no factor found up to √n, then n is prime:
This dramatically reduces the search space
Optimization 3: Prime-Only Testing
Only test prime divisors (requires pre-computed prime list):
Most efficient for repeated factorizations
4Complexity Analysis
Time Complexity
Space Complexity
5Wheel Factorization
Advanced technique that skips multiples of small primes systematically.
Wheel-2 (Skip Even Numbers)
Skip all even numbers after 2:
Skips 50% of candidates
Wheel-2,3 (Skip Multiples of 2 and 3)
Skip multiples of 2 and 3:
Skips 67% of candidates
General Wheel-W Formula
For wheel using first k primes:
Where p₁, p₂, ..., pₖ are the first k primes
6Advanced Algorithms
High-performance algorithms for factoring very large numbers.