aboutsummaryrefslogtreecommitdiffstats
path: root/ee2301
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ee2301/collatz.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ee2301/collatz.py b/ee2301/collatz.py
index d8d1ab8..acbc12e 100644
--- a/ee2301/collatz.py
+++ b/ee2301/collatz.py
@@ -1,5 +1,5 @@
def collatzCount(number):
- for n in range (1,number):
+ for n in range (1,number+1):
collatzConjecture(n)
print("\n")
@@ -8,7 +8,7 @@ def collatzConjecture(n):
if n is 1:
return 1
else:
- if (n%2):
+ if n%2:
return collatzConjecture(int((n*3)+1))
else:
return collatzConjecture(int(n/2))