Co9[n_, b_: 10] := With[{ans = FixedPoint[Total@IntegerDigits[#, b] &, n]}, If[ans == b - 1, 0, ans]];