# Modular arithmetic

i might be making it up, but i am confused.

can we say:

$$x\equiv$$2 (mod k)
$$x\equiv$$2 (mod m)
hence
$$x\equiv$$2 (mod km) by km i mean k multiplied by m.

if not, what is the result? or can it be found?

thank you in advance.

## Answers and Replies

Office_Shredder
Staff Emeritus
Gold Member
No.

k=4
m=8
x=10
x=2(mod 4) and x=2(mod 8) but x=10(mod 32)

In general, if you have something mod m and something mod k, and want to discuss what happens mod mk, then you need a condition on m and k being coprime, or something similar.

i think i found sth:

say (k,m) = 1

x=a (mod k)
x=a (mod m)

x=kt+a and x=my+a
kt=my
t=mb
y=kb

then x=kmb+a
x-a=kmb
x-a=0 (mod km)
x=a (mod km)

it is valid, isnt it? any counterexamples?

Office_Shredder
Staff Emeritus
Gold Member
That looks pretty good to me

:) then my problem is solved. now i should get back to work.

HallsofIvy