Solve sum of digits