Recursive, mathematical digit-summing function