Digital Root

let x = Sum( X[k]*10^k )
then x Mod 9 = Sum ( X[k] * 10^k Mod 9 ) = Sum( X[k] ) Mod 9
So DigitlalRoot(x) = x Mod 9