Implemented sum of digits in an integer