diff options
Diffstat (limited to 'OLD/ee2301/collatz.py')
-rw-r--r-- | OLD/ee2301/collatz.py | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/OLD/ee2301/collatz.py b/OLD/ee2301/collatz.py deleted file mode 100644 index 5f50ccc..0000000 --- a/OLD/ee2301/collatz.py +++ /dev/null @@ -1,21 +0,0 @@ -def collatzCount(k): - for n in range (1,k+1): - collatzConjecture(n) - print("\n") - -def collatzConjecture(n): - print(n, end = ' ') - if n is 1: - return 1 - elif n > 1: - if n%2: - return collatzConjecture(int((n*3)+1)) - else: - return collatzConjecture(int(n/2)) - raise AssertionError - - -try: - collatzCount(100000) -except AssertionError: - print("The Collatz Conjecture is false!") |