Skip to content

Files

Latest commit

Oct 6, 2018
effb5e8 · Oct 6, 2018

History

History
This branch is 537 commits behind matthewsamuel95/ACM-ICPC-Algorithms:master.

collatz_conjecture

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Oct 6, 2018
Oct 6, 2018
Oct 6, 2018

Collatz Conjecture

In the field of mathematics the collatz conjecture was posed by L. Collatz in 1937 which states that given a number n, one can always 'get to one' by applying the following function recursively on the number.

Function for Collatz Conjecture

  1. **If number is even ** :
    number = number / 2

  2. **If number is odd ** :
    number = (3 * number) + 1