Hi Guys,

Having some trouble with basic modular arithmetic, most of the materials i have dont seem to be helping..

a simple question 2 mod 10 = 2.. how did they get = 2?

3 mod 18 = 3, could you please explain the process

Printable View

- Dec 12th 2010, 12:55 PMextaticModular Arithmetic
Hi Guys,

Having some trouble with basic modular arithmetic, most of the materials i have dont seem to be helping..

a simple question 2 mod 10 = 2.. how did they get = 2?

3 mod 18 = 3, could you please explain the process - Dec 12th 2010, 01:08 PMtonio
$\displaystyle a=b\!\!\pmod n\Longleftrightarrow n\mid (a-b)\Longrightarrow a-b=kn$ , when all the letters__Definition__

here symbolize integer numbers.

Thus, $\displaystyle 2=2\!\!\pmod{10}$ because $\displaystyle 10\mid(2-2=0)\,,\,\,0=10\cdot 0$ , and etc.

A less trivial example: $\displaystyle 11=47\!\!\pmod{18}\,\,because\,\,11-47=-36=18\cdot (-2)$

Tonio - Dec 12th 2010, 01:15 PMextatic
- Dec 12th 2010, 01:45 PMtonio
- Dec 12th 2010, 02:00 PMPetek
I'd like to add to tonio's reply. Programmers use b (mod n) to represent the remainder upon dividing b by n. For example, 7 (mod 5) equals 2, since 7/5 = 1, with remainder 2. See , for example, section 3.4 of

*Concrete Mathematics*by Graham, Knuth and Patashnik. - Dec 12th 2010, 02:10 PMextatic
Thank you to you both :)

Petek thank you for that.. - Dec 12th 2010, 08:53 PMextatic
If this helps anyone,

2648 (mod 7)

2648 / 7 = 378.28...........

378 x 7 = 2646

2648 - 2646 = 2

2468 (mod 7) = 2

thanks for the help guys