From ebe9d7d0455010d9456fb336a3637ddfbdb48bcd Mon Sep 17 00:00:00 2001 From: RossTheRoss Date: Tue, 15 Oct 2019 10:57:11 -0500 Subject: Help --- ee2301/collatz.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ee2301') 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)) -- cgit v1.2.3