Project Euler

Problem 3

The prime factors of 13195 are 5, 7, 13 and 29.

What is the largest prime factor of the number 600851475143 ?

If you want, you can view this problem at Project Euler instead.

What You Should Do on Your Own

Assignments turned in without these things will not receive any points.

  1. After your program is done and working, add a comment at the top containing the final answer. If your program does not produce the correct answer in a reasonable amount of time, you will not receive points for this assignment.

Frequently-Asked Questions

Does 600851475143 fit in an int?
No, but it does fit in a long. Note that you will have to put an L after the number to use a long value in your Java code.
Why does my program take forever?
You are probably using a very slow method to determine if a number is prime. Try to speed that up!



©2013 Graham Mitchell

This assignment is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.
Creative Commons License