Finding the Greatest Factor without Factoring