In [1]:
"""
Problem 3
=========


   The prime factors of 13195 are 5, 7, 13 and 29.

   What is the largest prime factor of the number 600851475143 ?
"""

from sympy import *

def project_euler_3(x):
    """Returns the maximum prime factor of x."""
    return max(factorint(x))

project_euler_3(600851475143)


Out[1]:
6857