GithubHelp home page GithubHelp logo

kartmaan / collatz_conjecture Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 214 KB

Graphic representations of Collatz sequences

License: MIT License

Python 100.00%
collatz-conjecture conjecture syracuse mathematics pyqt5 pyqtgraph graphics collatz collatz-sequences collatz-problem

collatz_conjecture's Introduction

Collatz_conjecture

What's Collatz conjecture ?

The Collatz conjecture is defined as follows:

  • The starting value n is a positive integer
  • If the previous term x is even, the next term = x/2
  • If the previous term x is odd, the next term = x*3 + 1

The conjecture is that whatever the value of n, the sequence will always reach 1 before oscillating indefinitely on the values 4,2,1,4,2,1,4,2,1, .... (in this program, the sequence generation process stops as soon as it encounters a 1). The Collatz conjecture is still an unsolved problem in mathematics, it has not yet been shown that all sequences reach 1 for an integer and positive initial value.

What does the program do?

The program designed with PyQt5 and PyQtGraph generate Collatz conjecture sequences. The program allows to:

  • Visualize graphically a sequence from a single input value
  • Compare the sequences of two input values in the form of two superimposed graphs
  • Display more detailed statistics (flight time, time on altitude >n, max altitude, average altitude, number of even/odd values)
  • Save graphics in .png format
  • Copy the sequence(s) generated to the clipboard
  • Randomly generate Collatz sequences

Screenshots

Interface

collatz

Sequences pasted from clipboard

paste

Graph saved as .png image

97-649

Requirements

  • numpy
  • PyQt5
  • pyqtgraph
  • pyperclip

collatz_conjecture's People

Contributors

kartmaan avatar

Watchers

 avatar  avatar

collatz_conjecture's Issues

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.