Follow the algorithm.
Start with the number $40$40.
If the number is even, halve it. If the number is odd, subtract one and halve it.
Design algorithms involving branching and iteration to solve specific classes of mathematical problems