long numbers and sums of digits

piece of cake in python…