The Division Algorithm
We write (" divides ") when for some integer . For any integer and positive there are unique integers with and — the division algorithm. Divisibility is the case .
Everything in number theory grows from this one sentence. It says the integers sort into classes by remainder, that "divides" is a yes/no question with a computable answer, and that repeated division must terminate — which is what makes the Euclidean algorithm and base representations work. The uniqueness of and is what lets us say "the remainder" rather than "a remainder". Concretely, is the largest multiple of that does not pass , so (rounded DOWN, also for negative ), and is the distance from that multiple up to .
Divide by . The multiples of on either side of are and . The quotient counts the whole sevens that fit without passing , so ; the remainder is what is left over, . So , and as the theorem demands.
Divide by . The remainder must be non-negative, so has to be the multiple of at or BELOW . That is , not , which lies above. Then , and . The same answer comes from the formula : rounding down moves left on the number line, even for negatives.
When is divided by the remainder is . What remainder does leave? The information " leaves remainder " means exactly for some integer , so substitute: . The remainder is , whatever is. The part is a multiple of and can never affect the remainder — the first glimpse of modular arithmetic, where we will drop such terms from the start.
A calculator gives ; chopping off the decimals gives and then , a negative remainder, which the division algorithm forbids. Round down instead: and , so . Keep the notation straight as well: is a statement ("" is true, "" is false), while is a number.
Find and for , .
Show the answerHide the answer
The multiple of at or below is , so : , . (Not , : the remainder must be non-negative.)
Combining Divisibility Facts
If and , then for all integers . For instance and , so and . Two more facts complete the toolkit: if and then ; and if with then .
The proof is one line: and give , visibly a multiple of . The rule is used backwards far more often than forwards. To find what can divide two expressions, combine them so that the variable cancels; whatever divides both must divide what is left, and the size fact then cuts the possibilities down to a finite list of divisors.
Show that is in lowest terms for every positive integer . Suppose divides both the numerator and the denominator. Choose multipliers that make cancel: . By the combination rule , so : the two never share a factor. (Test : .)
Find all positive integers with . First divide the polynomial: . Since divides and also divides , it divides their difference, . The positive divisors of are , and , so or : or . Check: and .
Show that for all . First give both powers the same exponent: . The factorization shows that divides . So split , and the whole expression becomes — a combination of two multiples of . (Check : .)
The rule does not split products or sums. , yet and : the in went into the and the into the . Likewise although divides neither. "If then or " is true only when is prime, and proving even that takes the next topic.
Find all positive integers for which .
Show the answerHide the answer
Divide: , so must divide . For the divisor is , which divides only , so and , giving . Check : .
Divisibility Rules
A number is divisible by according to its last digit; by or according to its last two digits; by by its last three. By or when its digit sum is; by when the alternating digit sum is. By when by both and .
Every rule is the same idea: so a number is congruent to its digit sum mod ; so it is congruent to its alternating digit sum mod ; so only the last two digits matter mod . (The notation is defined properly in Modular Arithmetic; "Why It Works" below proves the rules without it.) Once you see them this way you can invent rules for , , or any modulus you like.
Is divisible by ? Alternate signs along the digits: , a multiple of , so yes (). Starting the signs from the left or from the right only changes the sign of the result, which does not affect divisibility.
Is divisible by ? Since , everything from the thousands digit up is a multiple of : . So only matters, and . Yes.
Find all digits making the five-digit number divisible by . Since with , test and separately. For : the last two digits must be a multiple of , so . For : the digit sum must be a multiple of , so or . Now match: needs ; needs ; needs . The numbers are , and .
Testing a composite divisor with factors that overlap. A number divisible by and by need not be divisible by : is a counterexample. "Divisible by and by " means "divisible by " only when — so test as , never as .
For which digit is divisible by ?
Show the answerHide the answer
Digit sum , which must be a multiple of . With the only choice is : .
Why It Works
Existence: among the integers () some are non-negative (take very negative). Let be the smallest non-negative one, with the corresponding . If then is a smaller non-negative member, contradiction; so . Uniqueness: if with both remainders in , then has absolute value less than , so it must be . The well-ordering of the non-negative integers — every non-empty set has a least element — is the engine, and it will power almost every proof in this course.
Write . Each is a multiple of , so is a multiple of , hence also of : and its digit sum leave the same remainder. For , each is a multiple of — , , — so minus its alternating digit sum is a multiple of . For and , the powers and are themselves multiples, so the higher digits drop out completely.