aboutsummaryrefslogtreecommitdiffstats
path: root/bigfactors2.py
diff options
context:
space:
mode:
authormjfernez <mjfernez@gmail.com>2020-02-09 15:16:26 -0500
committermjfernez <mjfernez@gmail.com>2020-02-09 15:16:26 -0500
commit93ea7fe5957b62f18e8fbd17a21696bd7de6332d (patch)
treed90aed60d687bcf195f1150777f37cbe8a149814 /bigfactors2.py
parent125ec5bc3d8bfc224b7d32bcfbbc37b9fb5d441f (diff)
downloadProject_Euler_Solutions-93ea7fe5957b62f18e8fbd17a21696bd7de6332d.tar.gz
Organized everything, update README
Diffstat (limited to 'bigfactors2.py')
-rw-r--r--bigfactors2.py34
1 files changed, 0 insertions, 34 deletions
diff --git a/bigfactors2.py b/bigfactors2.py
deleted file mode 100644
index 9e51502..0000000
--- a/bigfactors2.py
+++ /dev/null
@@ -1,34 +0,0 @@
-import PIL
-import math
-
-# Problem 12 Highly divisible triangular number
-# finds the first number with over 500 factors
-
-
-def countfactors(num):
- factors = 0
- # we only need to know about the FIRST HALF of factors,
- # one factor implies a second
- root = int(math.ceil(math.sqrt(num)))
- divs = range(1, root)
- for d in divs:
- if(num % d == 0):
- factors += 2
-
- # Correction if the number is a perfect square
- if (root * root == num):
- factors -= 1
- return factors
-
-
-#### MAIN #####
-i = 1
-k = 1
-j = 0
-while(k < 500):
- j += i
- k = countfactors(j)
- print(str(j) + " has " + str(k) + " factors")
- i += 1
-
-print("Ding! Ding! {} has over 500 factors, wow!".format(j))