<s>[INST] Prove "casting out nines" of an integer is equivalent to that integer modulo 9 Let $s(x)$ be an abstraction for casting out nines of integer $x$. For all integers $x$, prove $s(x) \equiv x$ mod $9$
I'm not asking for an answer more of a way to attack this problem. Can't think of where to start
 [/INST] Hint: Because $10\equiv 1\pmod{9}$, we have $10^k\equiv 1\pmod 9$ for any non-negative integer $k$. 
And note for example that $2013=2\times 10^3+0\times 10^2+1\times 10^1+3\times 10^0$. 
Added: Consider for example the $4$-digit number "$N=a_3a_2a_1a_0$" where the $a_i$ are digits. For example, with the $4$-digit number $7145$ we have $a_0=5$, $a_1=4$, $a_2=1$ and $a_3=7$. 
We want to show that $N$ and the sum $a_3+a_2+a_1+a_0$ have the same remainder on division by $9$, that is, are congruent to each other modulo $9$. Note that 
$$N=a_3\times 10^3+a_2\times 10^2+a_1\times 10^1+a_0\times 10^0.$$ Because $10^k\equiv 1\pmod 9$, we have
$$N\equiv a_3\times 1+a_2\times 1+a_1\times 1+a_0\times 1=a_3+a_2+a_1+a_0\pmod{9},$$
which is what we wanted to show.
We can also do it without congruences. For $$(1000a_3+100a_2+10a_1+a_0)-(a_3+a_2+a_1+a_0)=a_3(999)+a_2(99)+a_1(9),$$
and the right-hand side is clearly divisible by $9$.  
</s>