https://github.com/toydotgame/collatz-sequence-generator
A simple Java application to find information about a given Collatz Conjecture (also known as "the 3x+1 Problem") sequence of numbers.
https://github.com/toydotgame/collatz-sequence-generator
3nplus1 collatz-conjecture collatz-problem collatz-sequences collatzconjecture
Last synced: about 1 year ago
JSON representation
A simple Java application to find information about a given Collatz Conjecture (also known as "the 3x+1 Problem") sequence of numbers.
- Host: GitHub
- URL: https://github.com/toydotgame/collatz-sequence-generator
- Owner: toydotgame
- Created: 2021-08-17T09:00:58.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-09-01T00:38:44.000Z (over 4 years ago)
- Last Synced: 2025-02-15T00:41:29.391Z (over 1 year ago)
- Topics: 3nplus1, collatz-conjecture, collatz-problem, collatz-sequences, collatzconjecture
- Language: Java
- Homepage: https://en.wikipedia.org/wiki/Collatz_conjecture
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Collatz Sequence Generator
This is a simple program that I made as a proof of concept and simple introduction to the Collatz Conjecture (also known as _the 3x+1 Problem_).
## Use
### Requirements
* Java (>= 1.8.0\_292)
### Running
Download a JAR from the [_Releases_](https://github.com/toydotgame/collatz-conjecture-sequence-generator/releases) section, open a terminal in your download directory, and run this:
```sh
java -jar Collatz.jar
```
### Configuration
There are three options available currently:
Option Name | Options | Description
----------- | ------- | -----------
Show calculation steps? | `y` or `n` | Show each individual number in the sequence of numbers calculated. If `n` is chosen, stats will be shown at the end about sequence length, and numbers of odd and even numbers.
Print equations? | `y` or `n` | If a number is odd, `3 * x + 1 = y` is printed; and if even `x / 2 = y` is printed. The equations printed may differ from how the numbers themselves are internally calculated, but both the output and the internals of this program follow the rules of the Collatz Conjecture exactly.
Say if a number is odd or even? | `y` or `n` | Adds a prefix to the start of each line saying the odd/evenness of the previous number, and the new number that has been calculated \[according to the rules\].