Given a number n, find the minimum number of steps to get from 1 to n using only 2 operations:
- Multiply by 2
- Divide by 3
Is this possible to get to any n using only these two operations?
Given a number n, find the minimum number of steps to get from 1 to n using only 2 operations:
Is this possible to get to any n using only these two operations?
If I am understanding this correctly, then no.
If n equaled an integer that was not a power of 2, then you would not be able to reach that as you can't keep multiply 2's to 1 and get a non-power of 2. Dividing by 3 would just change the number to a fraction with a power of 3 in the denominator.