Project Euler #3: Largest prime factor

  • + 0 comments
    for a0 in range(t):
        n = int(input().strip())
        
        i = 2
        while i*i <= n:
            if n%i == 0:
                n //= i
            else:
                i += 1
        print(n)