You are viewing a single comment's thread. Return to all comments →
#!/bin/python3 import sys import math t = int(input().strip()) for a0 in range(t): n = int(input().strip()) nn = n k = 2 m = 1 sqrt = int(math.sqrt(n)) while(n!=1 and k<=sqrt): if(n%k==0 ): m = k n = n // k continue k = k+1 continue > print(max(m,n))``
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #3: Largest prime factor
You are viewing a single comment's thread. Return to all comments →