private static BigInteger FindSmallerOrEqualDeciBinary(BigInteger s)
var sb = new StringBuilder(s.ToString());
for(int i = 0; i < sb.Length; i++)
return BigInteger.Parse(sb.ToString().TrimStart('0'));
public static void Main()
var input = BigInteger.Parse("34");
while(current > BigInteger.Zero)
var deci = FindSmallerOrEqualDeciBinary(current);
Console.WriteLine($"{old} - {deci} = {current}");