Home

[This page is auto-generated; please prefer to read the article’s PDF Form.]



[Prev]   [Up]   [Next]   

Multiples of a Modulo n

Suppose a,n are any integers with n > 0. For i = 0,1,2,,n1, i.e. i n, what are the values obtained by (ai) mod n? Below we will prove a theorem which helps us to find them.

If we know such values for i n, we can trivially figure out (aj) mod n for any integer j, because (aj) mod n = (a(j mod n)) mod n, and (j mod n) n.

Theorem 2. For any integers a,n with n > 0, a mod n0, and g = gcd(a,n), the set of integers A = {(ai) mod n : i n} is same as set G = {0,g,2g,,((n∕g) 1)g}.

Proof. We will represent the value (ak) mod n, for any integer k (not necessarily in n), as vk.

For any integer a, say a= a mod n, and so a′ ∈ n. Thus, any value vi = (ai) mod n = ((a mod n)i) mod n = (ai) mod n. That means, the set of values obtained for a and aare exactly the same.

Thus, for the purpose of our proof we can assume a n, and the theorem will stand proved for any integer a.

Say, t is the least positive integer such that vt = 0. That is,

(at) mod n = 0  ⇔    n | at  ⇔   at is a multiple of n

Since a n and a mod n0, so a > 0. Also, t > 0, implying at > 0. Say m > 0 is an integer such that nm = at. But this is a positive common-multiple of a and n. Since we are looking for the least such t, so:

    at = lcm (a,n)
⇔   at = an ∕gcd(a,n) = an∕g

⇔    t = n ∕g

Note, g being the gcd of a and n, n∕g is an integer. The desired value t is n∕g. If g > 1, t = n∕g is in n.

But if g = 1, t = n, i.e. t is not in n. That means, (ai) mod n = 0 is attained only for i = 0 in n.

Now, consider all i < t, i.e. i = 0,1,2,,t1. Say, for some i1 and i2 among these, with i1 < i2, we obtain same value of vi. Then,

(ai1) mod n = (ai2) mod n   ⇔    (a(i2 − i1)) mod n = 0

Say t= i2 i1. So, (at) mod n = 0. But 0 < (i2 i1) < t. So, 0 < t< t, which is impossible since t is the least positive integer with (at) mod n = 0. Hence, for all i < t in n, values vi are distinct. Note that when g = 1, in which case t = n, all vi for i = 0,1,2,,n 1 are distinct.

Now, for any positive integer j, consider vt+j: vt+j = (a(t+j)) mod n = (at+aj) mod n = ((at) mod n+aj) mod n = (aj) mod n = vj.

That is, vt+1 = v1,vt+2 = v2,,vt+t = vt = 0 = v0. The cycle of vk values: (v0 = 0),v1,v2,,vt1, consisting of t distinct elements, keeps repeating for all integers k = t onward. That means, for i n, values vi consist of this t = n∕g sized cycle repeated g times.

We can now conclude that set A contains t = n∕g elements. What are these elements?

Consider any element (ai) mod n. (ai) mod n is nothing but ai nq for some integer q (Division Theorem). Since ga and gn, so: g(ai nq) g((ai) mod n).

So, each element vi of set A is a multiple of g. Also, 0 vi n 1 for any element vi of A (they are modulo n), and there are n∕g such elements. In the sequence of n consecutive integers 0,1,2,,n1 (where all vi belong), there are total n∕g multiples of g: 0,g,2g,,((n∕g) 1)g.

So, the total n∕g distinct elements of A, each being a multiple of g, can only be: G = {0,g,2g,,((n∕g) 1)g}. □

Corollary 3. For any integers a,b,n with n > 0, a mod n0, and g = gcd(a,n), the set of integers A = {(ai+b) mod n : i n} consists of values b,b + g,b + 2g,,b + ((n∕g) 1)g after taking their mod n.

Proof. Consider the set A= {(ai) mod n : i n} which is same as G = {0,g,2g,,((n∕g) 1)g}, due to Theorem 2.

For any integer i n, an element in set A, (ai + b) mod n, will equal ((ai) mod n + b) mod n. But (ai) mod n is an element in set A. So, (considering every i n) all the elements of A can simply be obtained by taking all elements of A, adding b to each and taking mod n. But all elements of Aare the set G. So, set A can be obtained from set G, such that each element k in G is modified to (k + b) mod n.

Now, for any two distinct integers j and k in n, we must have (j + b) mod n(k + b) mod n. So, modifying the elements of G (which is a subset of n) as above does not make any two of them equal. That is, A consists of same number of elements as are in G, which is n∕g.

In other words, A consists of: b,b+g,b+2g,,b+((n∕g)1)g, all taken mod n. □

Corollary 4. For any integers a,b,n with n > 0, a and n coprime (i.e. g = gcd(a,n) = 1), the set of integers A = {(ai+b) mod n : i n} is same as n = {0,1,2,,n 1}.

Proof. From Corollary 3, and g = 1, set A consists of below values after taking mod n: b,b + 1,b + 2,,b + (n 1).

But any set of n consecutive integers, when every element is taken mod n, will give the set of integers: {0,1,2,,n 1}. So, set A will also be same as {0,1,2,,n 1}. □

Corollary 5. If n is prime, we have g = gcd(a,n) = 1 for all integers a. So Corollary 4 applies for all integers a when n is prime.

We have now seen some characteristics of multiples of an integer a modulo another integer n. There is another side of this: if we are given such a multiple (ax) mod n, can we find out x? More generally, if we are given an integer k n, is there any integer x such that (ax) mod n = k. We will now try to understand existence of such x.

[Prev]   [Up]   [Next]