solved euler problem 3 FINALLY