Giter VIP home page Giter VIP logo

collatz's Introduction

Github user Anigulig:

Please visit this webpage: https://github.com/ZanderKraig44/Collatz/wiki

Collatz

A python program to run the Collatz algorithm. The Collatz conjecture is a conjecture in mathematics considered to be an extremely difficult problem to solve. It is named after Lothar Collatz, the person who introduced this idea.

The Collatz Conjecture is very simply stated and easy to understand. Take any arbitrary positive integer. If the number is even, divide it by 2 and if the number is odd, multiply the number by 3 and add 1. Perform the same operation on the number obtained and on the numbers obtained successively. The Collatz conjecture states that all such sequences will end in the number 1. For example:

3, 10, 5, 16, 8, 4, 2, 1 (Stepwise explanation below)

3 --> arbitrary positive integer

10 = 3 x 3 + 1

5 = 10 / 2

16 = 5 x 3 + 1

8 = 16 / 2

4 = 8 / 2

2 = 4 / 2

1 = 2 / 1

Stoptime:

The stoptime of any natural number (positive integer) with regards to the Collatz conjecture is defined as the number of steps that it takes for a given sequence to end. For example in the above sequence:

3, 10, 5, 16, 8, 4, 2, 1

The number of steps required = 7. Thus, the stoptime of 3 is 7.

One may notice that the stoptime of any given number is one less than the number of numbers in the sequence (stoptime of 3 = 8 - 1)

More information can be viewed at the wikipedia page https://en.wikipedia.org/wiki/Collatz_conjecture

Program specific information:

Please note that the program is not capable of error handling currently. Therefore, it would be necessary to rerun the program if the user hits an error while running the program. Errors should be minimal (only arising when the user provides input at the beginning of the program). I am currently working on this issue and will have it solved optimistically within a few days (by 15 August 2020).

Thank you to whoever uses the program. Please do tell your friends about the existence of a conjecture such as this. You may not mention to them about this program but it would be helpful if you do. This way, more people will come to know about the existence of the Collatz conjecture and will also have at hand a quick way to try it out. This is the aim of this project of mine, that is, to make more people aware.

collatz's People

Stargazers

 avatar  avatar  avatar  avatar  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.