0

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

  1. Any assumptions or overlooked concepts in my approach to explore this problem?

  2. 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?

Secret
  • 2,390
  • 1
    I think you're doing much more work than necessary here: it is not hard to show that equivalence modulo $m$ is a congruence, from which it follows immediately that if $n \equiv 1 \pmod{m}$, then $n^k \equiv 1 \pmod{m}$ for every $k \in \mathbb{Z}$. – A.P. Mar 19 '15 at 14:00
  • Well, $n\equiv1$ implies $n^2\equiv n$. It is always the case (for bases 3 or higher) that in base $n$ you can cast out $(n-1)$s. For example, in octal, $721$ is written $1321_8$, and $1+3+2+1=7$. You may also want to look up "casting out elevens". – Andrew Woods Mar 19 '15 at 14:02
  • I see After using your advice to redo the problem without the extra work, I got $$(n-1) \equiv 0 \pmod{m}$$ which is the same as saying that m=n-1 by the definition of residue class

    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
  • Taking the residue class modulo $1$ makes sense because it is well defined, but it is trivial because every number is in the same class. In this sense, casting out $1$ doesn't fail in base $2$, it is simply useless: recursively summing the digits of a binary number always gives you $1$. – A.P. Mar 19 '15 at 15:01
  • Unless that number is $0$, of course... – A.P. Mar 19 '15 at 15:08
  • I discuss the modular view of casting out nines and generalizations in many posts here, e.g. this one. – Bill Dubuque Mar 19 '15 at 16:17

0 Answers0