did the third one, returns all prime factors instead of just one, but just taking the highest is a simple thing