  In this research, an optimal algorithm for the Collatz conjecture is
presented. Properties such as the convergence of the algorithm and an equation
that relates the algorithm to the classical Collatz conjecture are obtained. It
is validated that the proposed theory is correct with several examples; as a
sector of mathematicians believes that the Collatz conjecture fails in some
power of $3$. The algorithm was applied to the first $600$ powers of $3$, where
the convergence of the proposed algorithm was verified.
