I tried to add all the digits in a number but it only adds the first and the last digit. For example 1111 -> 1+1+1+1 = 4 but I got 2, 47879 -> 35
1111 -> 1+1+1+1 = 4
47879 -> 35