Good day to all!
The objective of my task is apply the collatz function for a number x1
and print the exact number of iterations until s1
. I want to create a function using Module
:
CollatzFunction[x1_, s1_]:= Module[{.......};
Print iterations to s1
-> "number of iterations"
I barely have an idea using Nest[]
, but I don't know how to apply Nest
until the s1
number is reached.
Please, help in this task, it's just a step towards creating a more complicated function. Thanks.