So there was another question I managed to figure out similar to this one, which was "The number 538 is written on the board. At each step, a number N on the board can be replaced either by N − 1, or by N/2, provided that N is even. What’s the minimum number of steps to get from 538 to 0?"
I found a fast way to do this, which was to change 538 (or any other number) to binary form, and look at the last digit to perform the two operations. If the binary form ends in 0, 1) you use the divide by 2 operation and remove the 0. If the binary form ends in 1, 2) you use the minus 1 operation and change the ending digit to 0, where you proceed with 1). Ex: 538=1000011010, so you do divide by 2, minus 1, divide by 2, divide by 2, minus 1, divide by 2, minus 1, divide by 2, divide by 2, divide by 2, divide by 2, divide by 2, and then minus 1.
Is there a way to do this in the ternary system with a divide by 9 operation? Ex: if number in ternary end in 0, divide by 9 and remove 0 or something like that. I am asking if there is a rule where you can determine if a number is divisible by 9 in ternary without converting it to base ten.
Every number divisible by 9 has two zeroes at the end of its ternary expansion. The operation to remove a single zero from the end is divide by 3.