Modified the return type of some functions

int was not enough for the GreatesFactor function
Improved the primes related algorithms

After 2 is tested no more even numbers are tested.