While exploring $\mathbb{Z/n}$ I stumbled upon this
It explains that Casting Out Nines works because our common counting system is decimal and thus there exist a congruence relation as follows
$$10\equiv 1 \pmod{9}$$
which result in the remainder of the sum to become the sum of remainders
I was then curious on what the general case look like for any positive integer base n,
that is, how is n related to the modulus m in a "Casting Out m" system in base n.
Putting the above question in the context of base 10, I suspect I need to solve for m in the following equations given a known n (noting $n^0=1$)
$$\left\{\begin{matrix} n\equiv 1 \pmod{m} \\ n^{k}\equiv n^{k-1} \pmod{m}, k \in \mathbb{Z},k>1 \end{matrix}\right.$$
To get some idea on what the solution may look like I consider the following simpler case
$$\left\{\begin{matrix} n\equiv 1 \pmod{m} \\ n^2\equiv n \pmod{m} \end{matrix}\right.$$
Since this is a nonlinear congruence relation, I use Method of Successive Substitution to approach it
Rewriting 1st congruence equation as $$n=1+ym,y\in \mathbb{Z}$$ Plug this into the 2nd equation while also rewriting the LHS $$1+ym=(ym+n)^2$$ $$1+ym=y^2m^2+2ymn+n^2$$ $$y^2m^2+y(2mn-1)+(n^2-1)=0$$ y can then be solved with the quadratic formula, with the constraint that y must be $\in \mathbb{Z}$ y can then be rewritten as $$y'=y+mu,u \in \mathbb{Z}$$ Substituting this back to the 1st equation we found our n as $$n=1+(y+mu)m$$ $$(1-n)+ym+m^2u=0$$ Therefore our m is related with our n by a quadratic equation
Any assumptions or overlooked concepts in my approach to explore this problem?
The computation seems getting more complicated as you increase k towards infinity (expected because nonlinear congruence systems are NP hard according to this). How to check whether the solution to this problem always converges to some value for any positive integers n, that is,
is Casting out m always possible for any positive integer bases n?
However putting n=2 and the equation still holds, including the $$n^k \equiv 1 \pmod{m}$$, except I am not sure if m=1 actually make sense since in $\mathbb{Z/1}$ there's only one element in the residue class, 0. I guess that's why casting out m fails for binary base?
– Secret Mar 19 '15 at 14:20