Giter VIP home page Giter VIP logo

collatzconjecture's Introduction

Collatz Conjecture Calculator

This Python script calculates famous 3x+1 Problem and outputs "hailstone numbers". It is also named "3n + 1 conjecture, the Ulam conjecture (after Stanisław Ulam), Kakutani's problem (after Shizuo Kakutani), the Thwaites conjecture (after Sir Bryan Thwaites), Hasse's algorithm (after Helmut Hasse), or the Syracuse problem."(Wikipedia contributors, 2021b).

In case you are not satisfied with this basic explanation, here you can read detailed version

"The Collatz conjecture is a conjecture in mathematics that concerns sequences defined as follows: start with any positive integer n. Then each term is obtained from the previous term as follows: if the previous term is even, the next term is one half of the previous term. If the previous term is odd, the next term is 3 times the previous term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1. "(Wikipedia contributors, 2021b)

The sequence of numbers involved is sometimes referred to as the hailstone sequence or hailstone numbers (because the values are usually subject to multiple descents and ascents like hailstones in a cloud), or as wondrous numbers.(Wikipedia contributors, 2021b)

Also you may want to watch this video which made me write this script https://youtu.be/094y1Z2wpJg

References

Wikipedia contributors. (2021b, August 6). Collatz conjecture. Wikipedia. https://en.wikipedia.org/wiki/Collatz_conjecture


Install

  1. CLONE REPO
    git clone https://github.com/snmzcm/CollatzConjecture.git

OR

2.Download as Zip

Usage

Execute the script however you want and Enter a positive integer

It works like this:

Enter a positive integer
7
7  -Odd Number
22  -Even Number
11  -Odd Number
34  -Even Number
17  -Odd Number
52  -Even Number
26  -Even Number
13  -Odd Number
40  -Even Number
20  -Even Number
10  -Even Number
5  -Odd Number
16  -Even Number
8  -Even Number
4  -Even Number
2  -Even Number
1  -Odd Number


As you know last three numbers always will be looping according to the problem

License / Lisans

Distributed under the GNU License. See LICENSE for more information.

İletişim / Contact

[email protected]

LinkedIn

collatzconjecture's People

Contributors

snmzcm avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.