elementary number theory - Why casting out $9$'s and $11$'s works in divisibility tests (similarly for other bases) - Mathematics Stack ExchangeCasting out nines - Wikipedia