Consider the following operation on an arbitrary positive integer:
If the number is even, divide it by two.
If the number is odd, triple it and add one.
In modular arithmetic notation, define the function f as follows:
f
(
n
)
=
{
n
/
2
if
n
≡
0
(
mod
2
)
,
3
n
+
1
if
n
≡
1
(
mod
2
)
.
{\displaystyle f(n)={\begin{cases}n/2&{\text{if }}n\equiv 0{\pmod {2}},\\3n+1&{\text{if }}n\equiv 1{\pmod {2}}.\end{cases}}}
Now form a sequence by performing this operation repeatedly, beginning with any positive integer, and taking the result at each step as the input at the next.
In notation:
a
i
=
{
n
for
i
=
0
,
f
(
a
i
−
1
)
for
i
>
0
{\displaystyle a_{i}={\begin{cases}n&{\text{for }}i=0,\\f(a_{i-1})&{\text{for }}i>0\end{cases}}} (that is: ai is the value of f applied to n recursively i times; ai = f i(n)).
The Collatz conjecture is: This process will eventually reach the number 1, regardless of which positive integer is chosen initially. That is, for each
n
{\displaystyle n}, there is some
i
{\displaystyle i} with
a
i
=
1
{\displaystyle a_{i}=1}.
If the conjecture is false, it can only be because there is some starting number which gives rise to a sequence that does not contain 1. Such a sequence would either enter a repeating cycle that excludes 1, or increase without bound. No such sequence has been found.
The smallest i such that ai < a0 is called the stopping time of n. Similarly, the smallest k such that ak = 1 is called the total stopping time of n.[2] If one of the indexes i or k does not exist, we say that the stopping time or the total stopping time, respectively, is infinite.
The Collatz conjecture asserts that the total stopping time of every n is finite. It is also equivalent to saying that every n ≥ 2 has a finite stopping time.
Since 3n + 1 is even whenever n is odd, one may instead use the "shortcut" form of the Collatz function:
f
(
n
)
=
{
n
2
if
n
≡
0
(
mod
2
)
,
3
n
+
1
2
if
n
≡
1
(
mod
2
)
.
{\displaystyle f(n)={\begin{cases}{\frac {n}{2}}&{\text{if }}n\equiv 0{\pmod {2}},\\{\frac {3n+1}{2}}&{\text{if }}n\equiv 1{\pmod {2}}.\end{cases}}} This definition yields smaller values for the stopping time and total stopping time without changing the overall dynamics of the process. - Wikipedia. Solve no calc