Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/salamnocap/syracuse

The Syracuse Sequence
https://github.com/salamnocap/syracuse

ipython jupyter-notebook matplotlib plotext python seaborn syracuse vscode

Last synced: about 2 months ago
JSON representation

The Syracuse Sequence

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