Rewrote: Euler 3 - Prolog