Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
# Collatz-conjecture-Simple-Finder-Program
# Collatz conjecture Simple Finder Program

## Description
A $${\color{greenyellow}Simple \space \color{blue}Portable \space \color{green}Python}$$ Program for people to discover [Collatz Conjecture](https://en.wikipedia.org/wiki/Collatz_conjecture) $${\color{red}maximum \space \color{red}steps}$$ numbers.

A small project I created back in 2022, haven't had the time to fix the bugs. Now it should be all settled. Currently thinking about adding timely update (should be coming quite soon) and possibly a matplotlib graph.
A small project I created back in 2022, haven't had the time to fix the bugs. Now it should be all settled. Added a timely update for people who are anxious about whether or not the program is malfunctioning(aka stuck in an infinite while loop).
As mathematicians have not yet found the possibility of a number with infinite steps. I have not yet considered that edge case at the current moment.

Honestly speaking, I wasn't thinking about putting it out, but just realized that all my time of self-learning Python came from LeetCode. So here we are.

## Potential Update
- Output a CSV file for the result
- A matplotlib graph, maybe, in a different version?
- Reduce the base number in power, and include the suggested power, or directly continue from the last number. (Up to the user's decision)

## My honest suggestion

Honestly speaking, I wasn't thinking about putting it out, but just realized that all my time of self-learning Python came from LeetCode.
When giving the program a try on a larger starting power, make sure that you know how to stop a program (a.k.a keyboard interrupt, Ctrl+C in Linux and Windows Terminal)
Or else this program will run infinitely and consume majority of your CPU power.
2 changes: 0 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from math import pow
import time

def collatz_conjecture(starting_power):
Expand Down Expand Up @@ -41,7 +40,6 @@ def collatz_conjecture(starting_power):
result['numbers_with_max_steps'].append(num)
print(f"\n➕ Found another: {num:,} also takes {steps:,} steps")
last_print_time = time.time()

return result

print("Collatz Conjecture Maximum Steps Finder")
Expand Down