1

My rationale was the following. If $n$ is even, then

$$n \mid x - a \implies n \mid x - a - n \implies n \mid \frac{1}{2} (x - a - n) \implies 2n \mid x - a - n $$

so $x \equiv a + n \pmod{2n}$. On the other hand, if $n$ is odd, $(n:2)=1$. Hence the Chinese remainder theorem guarantees that the linear congruence system

$$\begin{cases} x \equiv a \pmod{n} \\ x \equiv a \pmod{2} \end{cases}$$

has a unique solution modulo $2n$. We know the solution is $x \equiv a(2+n) \mod{2n}$, which is congruent to $n \equiv a(2 - n) \pmod{2n}$.

Given that $n$ is odd, $(2+n:2-n)=1$. Therefore $x \equiv a \pmod{2n}$.

Is this more or less correct?

Bill Dubuque
  • 272,048
  • 1
    Something is fishy here. Take $n=4, x =3, a = 3$. Your proof says that since $n$ is even, 3 is congruent to 7 mod 8, which is not correct. Can you find the error? – user113102 May 28 '19 at 19:12

2 Answers2

1

I don't quite see what you are doing. Let $$ x-a = tn \; . $$

If $t$ is even, let $t = 2 s,$ so $$ x-a = s(2n) $$ so $$x \equiv a \pmod {2n}$$

If $t$ is odd, write $t = 2r + 1,$ so $$ x-a = tn = (2r+1)n = 2rn + n \; , $$ $$ x-a = r(2n) + n, $$ $$ x= a + n + r (2n) $$ $$x \equiv a +n \pmod {2n}$$

Will Jagy
  • 139,541
0

$\!\phantom{.} x\equiv a\pmod{\!n} \!\iff\!\! \overbrace{x = a \!+\! n\:\!\color{#0af}k}^{\large\text{for some } \color{#0af}k\ \in\ \Bbb Z}\!\!\! \iff\!\! \begin{align} &x ={{a\!+\!n\overbrace{(\color{#0a0}0\!+\!2j)}^{k\rm\ is\ \color{#0a0}{even}}}}\equiv a\!+\!\color{#0a0}0\,n\!\!\!\!\pmod{\!2n}\\[.3em] &x = {{a\!+\!n\underbrace{(\color{#c00}1\!+\!2j)}_{\!k\rm\ is\ \color{#c00}{odd}}}}\equiv \:\!a\!+\!\color{#c00}1\:\!n\!\!\!\!\pmod{\!2n} \end{align}$

$ $ using the Division Algorithm $\,(k\div 2)\,$ to write $\ \color{#0af}k = r\! +\! 2j\ $ for $\, r = \color{#0a0}0\,$ or $\,\color{#c00}1$


Or $\!\bmod 2n\!:\ kn \overset{\rm\color{#c00}D}\equiv (\overbrace{k\bmod 2}^{\large \color{#0a0}0\,\ {\rm or}\,\ \color{#c00}1})\:\!n\equiv \color{#0a0}0, \color{#c00}n\,$ $\overset{\!\!+\, a}\Rightarrow a\!+\!kn\equiv a\!+\!\color{#0a0}0,a\!+\!\color{#c00}n\ $
& $\:\!\ \bmod\:\! dn_{\phantom{|_|}}\!\!\!\!:\:\!\ kn \overset{\rm\color{#c00}D}\equiv (k\bmod d)\:\!n\equiv \color{#0a0}0n, \color{#c00}1n,2n,\ldots,(\color{#0af}d\!-\!1)n,\,$ takes $\,\color{#0af}d\,$ values,
where we invoked $\:\!\small\rm\color{#c00}D=$ mod Distributive law.

Bill Dubuque
  • 272,048