What to do when you have to chop an odd number? With a small boy not being as quiet as one hopes, and having to keep the count, it's taken me until last night to work out the algorithm that lets you do it with only a single flag in addition to the count. I expect this is already widely known to computer scientists, but here it is for everybody else:
180,0 - 90,0 - 45,0 - 22,1 - 11,1 - 6,0 - 3,0 - 1,1 - 1,0 - 0,1
It always ends with 0,1 so that's your termination condition
I imagine you can change the 2 to other integers and still have it work. I might try it tomorrow.