Fixed the error that missed primes

Suppose you entered 32, the program should say 2 is the largest prime
factor. But, it doesn't, it just quits.. because if (j>n/j) there is not
option on what to do if n==1. That is only possible if there is a
repetition of a prime factor at the end. Everything works fine if there
is no repetition, or if the repetition is not at the end. Fixed it
thanks to an error case on hackerrank.