Problem 59821. Largest Prime Factor
Write a function largest_prime_factor(n) that takes a positive integer n as input and returns the largest prime factor of n. A prime factor is a factor that is a prime number. For example, the largest prime factor of 12 is 3.
Solution Stats
Problem Comments
-
1 Comment
Grace
on 9 Apr 2024
The "end" does not allow the solution to work, for future reference try using the reference solutions to verify the test suite is passable.
Solution Comments
Show commentsProblem Recent Solvers1
Suggested Problems
-
1 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!