From ca1232e0ef923dfe6de7c6bc19588bb4402050ea Mon Sep 17 00:00:00 2001 From: Dece Date: Sun, 29 Dec 2019 03:08:53 +0100 Subject: [PATCH] Problem 3 --- problem3.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 problem3.py diff --git a/problem3.py b/problem3.py new file mode 100644 index 0000000..1bb0605 --- /dev/null +++ b/problem3.py @@ -0,0 +1,15 @@ +import math + +n = 600851475143 + +def pf(n): + factors = [] + for i in range(2, n): + if n / i == n // i: + n //= i + factors.append(i) + if n == 1: + break + return factors + +print(pf(n))