Attempting to efficiently compute the largest prime factor
Some advice about maths and algorithms which will be useful for this problem and for future problems:


You are interested in prime factors.
You don't care about the non-biggest factors (you might go through them but there is not much point in storing them).
If a number n can be decomposed in n = m*p then at least one of m and p is smaller than sqrt(n).