My goal is to be able to prove by induction that if I recursively sum the digits of a number $n$ (a natural number) until I am left with only one digit which is a member of $\{0, 3, 6, 9\}$ then $n$ is divisible by $3$.
Since this is supposed to be written recursively I wrote up a function $S(n) = \sum_{i=0}^k n_i + S(n)$ however I don't know how to stop it if it reaches one digit. What am I missing?