Giter Site home page Giter Site logo

lelserslasers / collatzconjecturevisualization Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 3.05 MB

​Customizable visualization of the Collatz conjecture in JavaScript

Home Page: https://lelserslasers.itch.io/collatz-conjecture

JavaScript 60.89% HTML 26.40% CSS 12.71%
collatz collatz-conjecture itch-io javascript js

collatzconjecturevisualization's Introduction

Collatz Conjecture Visualizations

​Customizable visualizations of the Collatz conjecture in JavaScript. Running live on the web at:

Graph

Showcase

Tree

Showcase

What is the Collatz conjecture?

The Collatz conjecture, also known as the 3n+1 conjecture or the hailstone sequence, is an unsolved mathematical problem. It was first proposed by German mathematician Lothar Collatz in 1937. The conjecture is defined as follows:

Start with any positive integer n. If n is even, divide it by 2 to get n/2. If n is odd, multiply it by 3 and add 1 to get 3n+1. Repeat the process with the resulting number, and continue iterating in the same way.

The conjecture states that no matter what positive integer you start with, this process will eventually reach the number 1. Once you reach 1, the sequence will enter a loop that repeats indefinitely: 1, 4, 2, 1, 4, 2, 1, and so on.

For example, let's take the starting number 6. The sequence will be: 6, 3, 10, 5, 16, 8, 4, 2, 1. In this case, it took eight steps to reach 1. However, the conjecture claims that for any positive integer, this sequence will eventually reach 1, even though the number of steps it takes may vary.

Despite its simplicity, the Collatz conjecture remains an unsolved problem in mathematics. No counterexamples have been found, meaning that all numbers tested so far eventually reach 1. However, no general proof has been established to show that this is true for all positive integers and the conjecture continues to be an active area of research.

collatzconjecturevisualization's People

Contributors

lelserslasers avatar lord-lelsers avatar

Stargazers

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