Math Fundamentals18 sections · 814 units
Open in Course

Problem - Largest Prime Factor

Find the biggest prime

Given a positive integer nn, find its largest prime factor. For example, if n=13195n = 13195, the prime factors are 5,7,13,295, 7, 13, 29, and the largest is 2929.

This problem appears in Project Euler and tests your understanding of prime factorization. You will apply the trial division method you learned earlier.