I have solved problem 3 of the Project Euler using java. I created a google code hosted project here where you can check out the solutions to the problems I have solved. In particular the solution to problem 3 is here
Problem003.java
Below I will try to describe the algorithm I used to solve the problem:
a) We will iterate starting at 3 to the number numberToGetLargestPrimeFactor / largestPrimeFactor . Where the numberToGetLargestPrimeFactor is initialized to 600851475143L and largestPrimeFactor is the largest prime number calculated up to that point in the iteraton, it is initialized at 1.
b) At each iteration we will check if the i divides numberToGetLargestPrimeFactor exactly.
c) If i divides numberToGetLargestPrimeFactor exactly then we will find out if i is a prime number.
d) To check if i is a prime number we do it by trying to divide i between the different numbers in the list of prime numbers. If it is divided by one of them then it means that i is not a prime number.
e) If i is a primer number then we store it in the list of primes. And we make largestPrimeFactor equal to the value of i.
Hope this helps in understanding the algorithm.