Thursday, October 7, 2010

Integer remainder repetition

I was just trying to solve a discrete math problem, when I bumped into the following:
take 2 prime numbers A and B, when you starting taking multiples of A, the remainders of those multiples after division by B will change at every multiple, and within B repetitions, they would have produced all possible remainders, this is quite 'intuitive' if we take an example.
Let us take 11 and 7.
11 x 1 = 7 x 1 + 4
11 x 2 = 7 x 3 + 1
11 x 3 = 7 x 4 + 5
11 x 4 = 7 x 6 + 2
11 x 5 = 7 x 7 + 6
11 x 6 = 7 x 7 + 3
11 x 7 = 7 x 11 + 0

The sequence of remainder is quite interesting: 4,1,5,2,6,3,0.
I guess it is possible to derive an equation for it depending on the 2 numbers but for now let us try to prove that within 7 multiples of 11, all possible remainders are generated.

It is not very hard:

No comments: