8000 GitHub - Roman-/collatz: Finding Collatz conjecture counterexample by accident · GitHub
[go: up one dir, main page]

Skip to content
Roman-Public

About

Finding Collatz conjecture counterexample by accident

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

20 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Collatz Conjecture (aka 3x+1 problem) Counterexample Finder

This program generates random large binary numbers and performs a futile attempt to find a counterexample to the well-known Collatz Conjecture. Spoiler: It probably won't.

Build

mkdir build && cd build
cmake ..
make

Build with tests

cmake -DBUILD_TESTS=ON ..
make

Run

./collatz

How it works

An N-bit binary number is generated, where N is defined at compile time (see Config.h). Starting from this initial number, the program searches upward, performing the 3x+1 operations in base two until it verifies that the number reduces below its initial value. Optimizations, such as skipping even numbers, are employed to enhance efficiency.

Example output

Checked 2611M numbers, max steps = 321, now on number 100000001010001010110111110010001001001101011110001010111110010100000001100011110001110011111101001001111101110110000111000110010001110110001011111100010000011011101010011011100000000101011000111000100011 (~2^203)
Checked 2612M numbers, max steps = 321, now on number 100000001010001010110111110010001001001101011110001010111110010100000001100011110001110011111101001001111101110110000111000110010001110110001011111100010000011011101010011011100000010100101001011100100011 (~2^203)
Checked 2613M numbers, max steps = 321, now on number 100000001010001010110111110010001001001101011110001010111110010100000001100011110001110011111101001001111101110110000111000110010001110110001011111100010000011011101010011011100000100011111010000000100011 (~2^203)
Checked 2614M numbers, max steps = 321, now on number 100000001010001010110111110010001001001101011110001010111110010100000001100011110001110011111101001001111101110110000111000110010001110110001011111100010000011011101010011011100000110011001010100100100011 (~2^203)
Checked 2615M numbers, max steps = 321, now on number 100000001010001010110111110010001001001101011110001010111110010100000001100011110001110011111101001001111101110110000111000110010001110110001011111100010000011011101010011011100001000010011011001000100011 (~2^203)
Checked 2616M numbers, max steps = 321, now on number 100000001010001010110111110010001001001101011110001010111110010100000001100011110001110011111101001001111101110110000111000110010001110110001011111100010000011011101010011011100001010001101011101100100011 (~2^203)
Checked 2617M numbers, max steps = 321, now on number 100000001010001010110111110010001001001101011110001010111110010100000001100011110001110011111101001001111101110110000111000110010001110110001011111100010000011011101010011011100001100000111100010000100011 (~2^203)
...

About

Finding Collatz conjecture counterexample by accident

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

0