rmykkänen

notes

Divisibility

date

When an integer is divided by a second integer, the quotient may or may not be an integer.

Def: If aa and bb are integers, aa divides bb if there exists an integer cc such that b=acb = ac. This makes aa a factor of bb.

If aa divides bb, we write a∣ba \mid b. Otherwise, a∤ba \nmid b.

Proposition 1: If a,b,ca, b, c are integers with a∣ba \mid b and b∣cb \mid c, then a∣ca \mid c.

Proof: Since a∣ba \mid b and b∣cb \mid c, there exist integers e,fe, f with ae=bae = b and bf=cbf = c. Hence, bf=(ae)f=a(ef)=cbf = (ae)f = a(ef) = c, and a∣ca \mid c.

Proposition 2: If a,b,m,na, b, m, n are integers, and if c∣ac \mid a and c∣bc \mid b, then c∣(ma+nb)c \mid (ma+nb).

Proof: Since c∣ac \mid a and c∣bc \mid b, there are integers e,fe, f such that a=cea = ce and b=cfb = cf. Hence, ma+nb=mce+ncf=c(me+nf)ma + nb = mce + ncf = c(me + nf). Consequently, c∣(ma+nb)c \mid (ma + nb).

Ex: Since 3∣213 \mid 21 and 3∣333 \mid 33, Proposition 2 asserts that:

3∣(5∗21−3∗33)=105−99=6\begin{equation} 3 \mid (5 * 21 - 3 * 33) = 105 - 99 = 6 \end{equation}

The division theorem

If a,ba, b are integers such that b>0b > 0, then there are unique integers q,rq, r such that a=bq+ra = bq + r, with 0<=r<b0 <= r < b.

To prove this, let's define a new function.

Def: Let xx be a real number. The greatest integer in xx, denoted by [x][x], is the largest integer less than or equal to xx.

Ex: [2.2]=2,[3]=3,[−1.5]=−2[2.2] = 2, [3] = 3, [-1.5] = -2

Proposition 3: If xx is a real number, then x−1<[x]<=xx-1 < [x] <= x.

We can now prove the division algorithm. We give explicit formulae for the quotient and remainder in terms of the greatest integer function.

Proof: Let q=[a/b]q = [a/b] and r=a−b[a/b]r = a - b[a/b]. Clearly, a=bq+ra = bq + r. To show that the remainder rr satisfies the appropriate inequality, note Proposition 3:

(a/b)−1<[a/b]<=a/b\begin{equation} (a/b)-1 < [a/b] <= a/b \end{equation}

Multiply all sides by bb.

a−b<b[a/b]<=a\begin{equation} a - b < b[a/b] <= a \end{equation}

Multiply all sides by −1-1.

−a+b>−b[a/b]>=−a\begin{equation} -a + b > -b[a/b] >= -a \end{equation}

Add aa.

b>−b[a/b]+a>=0\begin{equation} b > -b[a/b] + a >= 0 \end{equation}

To show that qq and rr are relatively unique, assume that we have two equations: a=bq1+r1a = bq_1 + r_1 and a=bq2+r2a = bq_2 + r_2, with 0<=r1,r2<b0 <= r_1, r_2 < b. By subtracting the second of these from the first, we find:

0=b(q1−q2)+(r1−r2)\begin{equation} 0 = b(q_1 - q_2) + (r_1 - r_2) \end{equation}

Hence:

r2−r1=b(q1−q2)\begin{equation} r_2 - r_1 = b(q_1 - q_2) \end{equation}

This tells us that bb divides r2−r1r_2 - r_1. Since 0<=r1,r2<b0 <= r_1, r_2 < b, −b<r2−r1<b-b < r_2 - r_1 < b. This shows that bb can divide r2−r1r_2 - r_1 only if r2−r1=0r_2 - r_1 = 0, so if r1=r2r_1 = r_2. bq1+r1=bq2+r2∴q1=q2bq_1 + r_1 = bq_2 + r_2 \therefore q_1 = q_2. This shows that qq and rr are unique.

Ex: Let a=1028,b=34a = 1028, b = 34. Then a=bq+ra = bq + r with 0<=r<b0 <= r < b, where q=[1028/34]=30q = [1028/34] = 30 and r=1028−[1028/34]∗34=1028−30∗34=8r = 1028 - [1028/34] * 34 = 1028 - 30*34 = 8.