https://github.com/salamnocap/syracuse
The Syracuse Sequence
https://github.com/salamnocap/syracuse
ipython jupyter-notebook matplotlib plotext python seaborn syracuse vscode
Last synced: 10 months ago
JSON representation
The Syracuse Sequence
- Host: GitHub
- URL: https://github.com/salamnocap/syracuse
- Owner: salamnocap
- License: mit
- Created: 2022-11-23T16:20:03.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-23T19:07:47.000Z (about 3 years ago)
- Last Synced: 2025-03-13T00:17:40.212Z (10 months ago)
- Topics: ipython, jupyter-notebook, matplotlib, plotext, python, seaborn, syracuse, vscode
- Language: Jupyter Notebook
- Homepage:
- Size: 58.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Syracuse
## The Syracuse Sequence
The Syracuse (Collatz or Hailstone) conjecture concerns a sequence of integers defined as follows:
Starts with any positive integer N
And each term is formed from the previous one as follows:
if the previous term is odd:
the next term is 3 times the previous term and plus 1
$$
3*N + 1
$$
if the previous term is even:
the next term is half the previous term
$$
N / 2
$$
The sequence will always reach 1. 🏁
## Solution
+ Solution in IPython Notebook 8.5.0:
[Syracuse.ipynb](https://github.com/skuantaiuly/Syracuse/blob/main/Syracuse.ipynb)
+ Solution in Python 3.10.6:
[Syracuse.py](https://github.com/skuantaiuly/Syracuse/blob/main/Syracuse.py)
#### Additional libraries used for visualization:
Seaborn
```
pip install seaborn
```
Matplotlib
```
pip install matplotlib
```
Plotext
```
pip install plotext
```
## Clone this repository :
```
$ git clone https://github.com/skuantaiuly/Syracuse.git
```
## Author
Kuantaiuly Salamat
11/2022, developed on IPython and Jupyter Notebook, Visual Studio Code