#!/usr/bin/python import math; import sys; def factor(num): higherFactor = -1; for i in range (2,int(math.sqrt(num))+1): if((num % i) == 0): newFactor = factor(i); if(newFactor > higherFactor): higherFactor = newFactor; newFactor = factor(num/i); if(newFactor > higherFactor): higherFactor = newFactor; return higherFactor; if(num > higherFactor): higherFactor = num; return higherFactor; print "Result is: " + str(factor(int(sys.argv[1])));