Showing posts with label numbers. Show all posts
Showing posts with label numbers. Show all posts
Saturday, December 30, 2017
Number System
In a slightly eccentric numbering system, the numbers on the left are converted to regular decimal numbers by applying a simple rule.
9999 = 4
8888 = 8
1816 = 3
1212 = 0
Can you answer
2419 = ?
Click below for the answer.
Labels:
logic puzzles,
numbers
Saturday, December 23, 2017
Fraction of 1000
What is 1/2 of 2/3 of 3/4 of 4/5 of 5/6 of 6/7 of 7/8 of 8/9 of 9/10 of 1000? Click below for the answer.
At first glance, this problem looks a lot harder than it is. If you work backwards starting at 9/10 of 1000, it's easier to see that the final answer is 100.
Saturday, December 16, 2017
Three Water Bottles
You have three water bottles with capacities of 8 quarts, 5 quarts, and 3 quarts. The largest bottle is filled with water, and the other two are empty. If there are no graduation marks on any of the bottles, how can you split the water evenly so that two of the bottles contain exactly 4 quarts each? You can only use these three bottles. Click below for the answer.

There may be other ways to solve this problem, but here's one sequence that works.
- Fill the 5 quart bottle, leaving 3 quarts in the 8 quart bottle.
- Pour 3 quarts from the 5 quart bottle into the 3 quart bottle, leaving 2 quarts in the 5 quart bottle.
- Empty the 3 quart bottle into the 8 quart bottle , leaving 6 quarts in the 8 quart bottle.
- Pour the 2 quarts from the 5 quart bottle into the 3 quart bottle.
- Fill the 5 quart bottle from the 8 quart bottle , leaving 1 quart in the 8 quart bottle.
- Pour 1 quart from the 5 quart bottle into the 3 quart bottle (filling it), leaving 4 quarts in the 5 quart bottle.
- Pour the 3 quarts from the 3 quart bottle into the 8 quart bottle, leaving 4 quarts in the 8 quart bottle.
| 8 qt. | 5 qt. | 3 qt. |
|---|---|---|
| 8 | 0 | 0 |
| 3 | 5 | 0 |
| 3 | 2 | 3 |
| 6 | 2 | 0 |
| 6 | 0 | 2 |
| 1 | 5 | 2 |
| 1 | 4 | 3 |
| 4 | 4 | 0 |
Labels:
logic puzzles,
math,
numbers
Saturday, October 21, 2017
Draw Two
Two numbers are drawn at random from the integers 1 through 10. What is the expected value of their sum? Does it change if the second draw is done with or without replacement? Click below for the answers.
This puzzle is from Patrick Honner. It's easy to calculate the expected value with replacement. It's just two times the expected value of a random draw from 1...10, so 2 * 5.5, or 11. The interesting part is that when you draw two numbers without replacement the expected sum doesn't change. Why is that?
To find out, take a look at what happens to the expected value of the second draw for each value of the first draw. (Expected value is just the average of the remaining numbers.)
As the value of the first draw increases, the expected value of the second draw decreases. If you take the sum of each column you get 55. Divide by 10 to get the average and you get 5.5, so when you add them together you arrive back at the solution of 11.
See my Probability GitHub repository for a script that shows how to model this problem in Python.
To find out, take a look at what happens to the expected value of the second draw for each value of the first draw. (Expected value is just the average of the remaining numbers.)
| 1st draw | E(2nd draw) |
|---|---|
| $1$ | $6$ |
| $2$ | $5\frac{8}{9}$ |
| $3$ | $5\frac{7}{9}$ |
| $4$ | $5\frac{2}{3}$ |
| $5$ | $5\frac{5}{9}$ |
| $6$ | $5\frac{4}{9}$ |
| $7$ | $5\frac{1}{3}$ |
| $8$ | $5\frac{2}{9}$ |
| $9$ | $5\frac{1}{9}$ |
| $10$ | $5$ |
As the value of the first draw increases, the expected value of the second draw decreases. If you take the sum of each column you get 55. Divide by 10 to get the average and you get 5.5, so when you add them together you arrive back at the solution of 11.
See my Probability GitHub repository for a script that shows how to model this problem in Python.
Saturday, October 14, 2017
Chicken McNuggets
You drove for hours last week to get your hands on McDonald's limited edition Szechuan sauce, and now you need some chicken nuggets for you and all of your friends. You can buy McNuggets in boxes of 6, 9, and 20. What is the largest whole number of nuggets that it is not possible to obtain by purchasing some combination of boxes of 6, 9, and 20? Click below for the answer.

There might be cleverer solutions to this problem, but we can do this fairly easily by listing combinations. Once we hit a streak of six numbers in a row that we can obtain, we know that the last number we couldn't obtain before the streak is the largest such number. Beyond that streak of six we can just add one or more boxes of 6 nuggets to one of those numbers to obtain any higher number. (There may be other combinations to obtain some of these numbers, but we only need one combination for each.)
That's six in a row, so we can get any higher number of nuggets just by adding boxes of 6 to those combinations. That means that 43 is the largest number of Chicken McNuggets that you cannot buy by combining boxes of 6, 9, and 20.
| Number | Boxes |
|---|---|
| 1 | Not Possible |
| 2 | Not Possible |
| 3 | Not Possible |
| 4 | Not Possible |
| 5 | Not Possible |
| 6 | 6 |
| 7 | Not Possible |
| 8 | Not Possible |
| 9 | 9 |
| 10 | Not Possible |
| 11 | Not Possible |
| 12 | 6 + 6 |
| 13 | Not Possible |
| 14 | Not Possible |
| 15 | 6 + 9 |
| 16 | Not Possible |
| 17 | Not Possible |
| 18 | 9 + 9 |
| 19 | Not Possible |
| 20 | 20 |
| 21 | 6 + 6 + 9 |
| 22 | Not Possible |
| 23 | Not Possible |
| 24 | 6 + 9 + 9 |
| 25 | Not Possible |
| 26 | 20 + 6 |
| 27 | 9 + 9 + 9 |
| 28 | Not Possible |
| 29 | 20 + 9 |
| 30 | 6 + 6 + 9 + 9 |
| 31 | Not Possible |
| 32 | 6 + 6 + 20 |
| 33 | 6 + 9 + 9 + 9 |
| 34 | Not Possible |
| 35 | 6 + 9 + 20 |
| 36 | 9 + 9 + 9 + 9 |
| 37 | Not Possible |
| 38 | 9 + 9 + 20 |
| 39 | 6 + 6 + 9 + 9 + 9 |
| 40 | 20 + 20 |
| 41 | 6 + 6 + 9 + 20 |
| 42 | 6 + 9 + 9 + 9 + 9 |
| 43 | Not Possible |
| 44 | 6 + 9 + 9 + 20 |
| 45 | 9 + 9 + 9 + 9 + 9 |
| 46 | 6 + 20 + 20 |
| 47 | 9 + 9 + 9 + 20 |
| 48 | 6 + 6 + 9 + 9 + 9 + 9 |
| 49 | 9 + 20 + 20 |
That's six in a row, so we can get any higher number of nuggets just by adding boxes of 6 to those combinations. That means that 43 is the largest number of Chicken McNuggets that you cannot buy by combining boxes of 6, 9, and 20.
Saturday, October 7, 2017
Pennies
Would you rather have a ton of pennies, four miles of pennies lined up end-to-end, or a stack of pennies half a mile tall? Click below for a hint, or for the answer.

One penny weighs 2.500 grams (according to the U.S. Mint).
There are about 28.35 grams in an ounce
There are 16 ounces in a pound.
There are 2,000 pounds in a (U.S.) ton.
One penny is 0.750 inches in diameter.
There are 12 inches in a foot.
There are 5,280 feet in a mile.
One penny is 1.52 millimeters thick.
There are 25.4 millimeters in an inch.
There are about 28.35 grams in an ounce
There are 16 ounces in a pound.
There are 2,000 pounds in a (U.S.) ton.
One penny is 0.750 inches in diameter.
There are 12 inches in a foot.
There are 5,280 feet in a mile.
One penny is 1.52 millimeters thick.
There are 25.4 millimeters in an inch.
Four miles of pennies lined up end-to-end would be $3,379.20, while one ton is $3,628.80, so between the first two options you would be better off to take the ton. However, a stack of pennies half a mile tall would be $5,293.89, so the stack is by far the best option.
Saturday, September 30, 2017
Western Leaders
Here's a freaky coincidence about World War II. If you add up the year of birth, age in 1944, year of taking power, and the number of years in office in 1944 for each of the five main leaders of the Western world during World War II, the sums are all the same.
| Churchill | Hitler | Mussolini | Roosevelt | Stalin | |
|---|---|---|---|---|---|
| Year of birth | 1874 | 1889 | 1883 | 1882 | 1878 |
| Age in 1944 | 70 | 55 | 61 | 62 | 66 |
| Took power | 1940 | 1933 | 1922 | 1933 | 1922 |
| Years in office | 4 | 11 | 22 | 11 | 22 |
| Sum | 3,888 | 3,888 | 3,888 | 3,888 | 3,888 |
Can you explain this coincidence? Click below for the answer.
There's really no coincidence at all. If you take any person's year of birth and add their age in 1944, the sum will be... 1944. This also goes for the year a leader took office and the number of years they had held office in 1944, so the sum of all four values will always be 1944 + 1944 = 3888. You can make your own puzzle using any year as a reference point.
Saturday, September 16, 2017
Digit Frequency
If you write down all the numbers from 1 to 1000 (inclusive) which digit occurs most frequently? Which digit appears least frequently in the same range? Click below for the answers.
You could write all the numbers down or write a program to count the digit frequencies, but this problem is much easier if you look for a pattern. The digits 0 through 9 all appear the same number of times in the ones place, but 1 through 9 appear a lot more often in the tens and hundreds place (because of numbers like 22, 222, etc., and the fact that we don't write leading 0s). This means that 0 is the least frequent digit. It only appears 192 times in the specified range. What about the most frequent? The digits 1 through 9 appear with exactly the same frequency in the range 1 to 999 (300 times each), so that extra occurrence (in the number 1000) makes 1 the most frequent digit from 1 to 1000.
Saturday, May 20, 2017
Number Words
In the solution to A Unique Number, I asked a bonus question. "Can you think of a number whose letters when spelled out in English are all in alphabetical order?" Several people replied via Twitter with the correct answer of "forty." You may have found a shortcut to the solution if you noted that none of the single-digit numbers have their letters in alphabetical order, nor does the word "teen." This allows you to skip ahead to 20, 30, etc. Can you use a similar strategy to answer the following questions?
- What is the lowest number that requires the five vowels A, E, I, O, and U only once each in its spelling?
- What is the lowest number that requires the six letters A, E, I, O, U, and Y only once each in its spelling?
The lowest number that requires the five vowels A, E, I, O, and U once each in its spelling is 206 (two-hundred and six).
The lowest number that requires the six letters A, E, I, O, U, and Y once each in its spelling is 230 (two-hundred and thirty).
The strategy to quickly find these answers is to note which vowels are used in the base numbers, one, two, three, etc, then avoid combinations that include multiples of the same vowel. For example, you can skip past the 100s entirely, because "one-hundred" contains two of the letter "e".
The lowest number that requires the six letters A, E, I, O, U, and Y once each in its spelling is 230 (two-hundred and thirty).
The strategy to quickly find these answers is to note which vowels are used in the base numbers, one, two, three, etc, then avoid combinations that include multiples of the same vowel. For example, you can skip past the 100s entirely, because "one-hundred" contains two of the letter "e".
Labels:
brain teasers,
numbers,
puzzles
Saturday, April 15, 2017
Move One Digit
The following equation is incorrect. Can you make the equation balanced by moving only a single digit?
101 - 102 = 1
Click below to see the answer.
The digit that needs to be moved is the 2. Just move it up into the exponent and the equation is correct.
101 - 102 = 1
101 - 102 = 1
Saturday, April 8, 2017
What is the next number in the sequence?
Without Googling it, can you tell me the next number in the following sequence?
1
11
21
1211
111221
312211
13112221
1113213211
That should be enough to see the pattern, but this sequence goes on infinitely. Click below to see the answer.
This sequence is known as the "Look and Say" or "Say What You see" sequence. Each term is formed by describing the previous term. The first term is just the digit 1. To describe it you would say "one one," so the next term is 11. To describe that you'd say "two one," and so on. The next term after the ones shown is 31131211131221. Check the Online Encyclopedia of Integer Sequences (A005150) for more terms following that.
Saturday, March 25, 2017
10-digit Number
Find a 10-digit number where the first digit is how many 0's there are in the number, the second digit is how many 1's in the number, the third digit is how many 2's, and so on, until the tenth digit which is how many 9's there are in the number.
Click below to see the answer.
As a programmer, I'm often tempted to try to use a brute force approach to find the answers to number puzzles. That often works, but when brute force involves looping through all 10-digit numbers, you should probably look for a more elegant approach.
Let's see if we can construct the solution using logic instead. We can't have 0 zeroes, because then we would have to put 0 in the zeroes digit, and it would immediately be wrong. I'll start with a 9 in the zeros digit and the rest zeros, then make corrections until we hit on a solution.
90000 00000
Now we have a 9, so there should also be a 1 in the 9 column.
90000 00001
But now there aren't 9 zeroes, there are only 8. There's also a 1, which means we have to change the first and second digits.
81000 00001
Wait, now there isn't a 9, so we have to move that last 1 over. There are also two 1's, so we have to change the second digit.
82000 00010
That's closer, but now there is a 2, so we have to record it in the twos column. There are also fewer 0's, so we have to change the first digit as well.
72100 00010
Still not quite right. There are now only six 0's, so we have to change the first digit again. There's also no longer an 8. We can make both of these changes at once, giving us a final answer of
62100 01000
Let's see if we can construct the solution using logic instead. We can't have 0 zeroes, because then we would have to put 0 in the zeroes digit, and it would immediately be wrong. I'll start with a 9 in the zeros digit and the rest zeros, then make corrections until we hit on a solution.
90000 00000
Now we have a 9, so there should also be a 1 in the 9 column.
90000 00001
But now there aren't 9 zeroes, there are only 8. There's also a 1, which means we have to change the first and second digits.
81000 00001
Wait, now there isn't a 9, so we have to move that last 1 over. There are also two 1's, so we have to change the second digit.
82000 00010
That's closer, but now there is a 2, so we have to record it in the twos column. There are also fewer 0's, so we have to change the first digit as well.
72100 00010
Still not quite right. There are now only six 0's, so we have to change the first digit again. There's also no longer an 8. We can make both of these changes at once, giving us a final answer of
62100 01000
Saturday, March 18, 2017
The Extra Dollar
Here is an old math puzzle that you can find many versions of online.
Two friends have a meal at a restaurant, and the bill is $25. The friends pay $15 each, which the waiter gives to the cashier. The cashier gives back $5 to the waiter. The friends tell the waiter to keeps $3 as a tip, so he hands back $1 to each of the two diners.
So, the friends paid $14 each for the meal, for a total of $28. The waiter kept $3, and that makes $31. Where did the extra dollar come from? Give yourself a moment to think about it before clicking below for the solution.
$25 is sitting with the cashier, $2 is back with the diners, and $3 is with the waiter. That adds to the required $30, so there really is no extra dollar.
The mistake is expecting that what the diners paid and what the waiter kept to add up to what they initially gave. Adding $28 and $3 is just a bit of sleight-of-hand. It's the amount that the meal effectively cost them (including tip), plus the amount they received back, that should add to $30.
The mistake is expecting that what the diners paid and what the waiter kept to add up to what they initially gave. Adding $28 and $3 is just a bit of sleight-of-hand. It's the amount that the meal effectively cost them (including tip), plus the amount they received back, that should add to $30.
Labels:
logic puzzles,
numbers
Saturday, March 11, 2017
Arranging Eights
Can you arrange eight 8's so that when added they will equal 1000? Click below to see the answer.
It's certainly possible to try all 22 different ways to partition eight identical digits, but there is a shortcut.
All of the numbers that are created by arranging eight 8's will end in the digit 8, and the sum of the last digits of those numbers must be a multiple of 10 (because the target sum of 1000 ends in 0), so we know there must be exactly five groups of digits in the correct solution. That means we only have to check 3 different partitions of the eight digits.
8888 + 8 + 8 + 8 + 8
888 + 88 + 8 + 8 + 8
88 + 88 + 88 + 8 + 8
These are the only three ways to partition eight identical objects into five groups, and they are the only groupings whose sums end in the digit 0. You can check with quick mental arithmetic that the second grouping is the correct solution.
All of the numbers that are created by arranging eight 8's will end in the digit 8, and the sum of the last digits of those numbers must be a multiple of 10 (because the target sum of 1000 ends in 0), so we know there must be exactly five groups of digits in the correct solution. That means we only have to check 3 different partitions of the eight digits.
8888 + 8 + 8 + 8 + 8
888 + 88 + 8 + 8 + 8
88 + 88 + 88 + 8 + 8
These are the only three ways to partition eight identical objects into five groups, and they are the only groupings whose sums end in the digit 0. You can check with quick mental arithmetic that the second grouping is the correct solution.
Saturday, March 4, 2017
A Unique Number
What is unique about the number 8,549,176,320? Click below to see the answer (and a bonus question).
There's nothing numerically particularly unique or interesting about the number above. It is made up of all of the digits from 0 to 9, but a lot of numbers have that property. The unique thing about this number is that all of the digits from 0 to 9 are in alphabetical order when spelled out in English.
Bonus question: Can you think of a number whose letters when spelled out in English are all in alphabetical order? Example: The first three letters of the word "five" are in alphabetical order, but the "e" at the end spoils it.
Bonus question: Can you think of a number whose letters when spelled out in English are all in alphabetical order? Example: The first three letters of the word "five" are in alphabetical order, but the "e" at the end spoils it.
Labels:
brain teasers,
numbers,
puzzles
Saturday, June 13, 2009
Casting Out Nines
You may already be familiar with the divisibility rule that says a number is evenly divisible by 9 if and only if the sum of its digits is also divisible by 9. For example, I know 3,645 is divisible by 9 without dividing because its digits add up to 18, which I remember from elementary school to be 2 * 9.
This is an interesting rule because it leads to a recursive property of divisibility by 9. Notice that the digits of 18 in the preceding example also add up to 9. If we have a larger number like 13,286,025,801 we can repeatedly apply the same rule until we get down to one digit. Only if that single digit is a 9 is the original number (and every digital sum in between) divisible by 9.
For example, the sum of the digits of 13,286,025,801 is:
This process of repeatedly summing the digits of a number until you're left with a single digit is called finding the number's digital root. If the digital root of a number is 9, then that number is divisible by 9.
For small numbers like the ones above it's easy to just do long division to see if a number is evenly divisible by 9, but for extremely large numbers with hundreds of digits, division can be quite time consuming. For example, can you tell me if
is divisible by 9? You might be awhile if you try to solve this using long division. I can tell you that this number is divisible by 9, but before you add up all the digits, let me show you a shortcut called "casting out nines." Let's first try it out on the following example, which is a little bit more manageable
To understand why the test for divisibility by 9 works, we need to use a few properties of congruences. Let's start with the fact that
which in English says that 10 is congruent to 1 modulus 9, or in plain English that 10 and 1 both leave the same remainder (sometimes called the residue) when divided by 9. (In fact, if the right-hand side of the congruence, in this case 1, is less than the modulus, then the right-hand side is the remainder when the left-hand side is divided by the modulus.) In general,
says that the difference between b and c is evenly divisible by n.
One algebraic property of congruences says that we can raise both sides of the congruence to the same power and the modulus will stay the same (this can be more generally stated as P(a) ≡ P(b) (mod n), where P(x) is any polynomial). Using this property we can say that
or
You can substitute any non-negative whole exponent you like.
So 10 raised to any natural exponent will leave a remainder of 1 when divided by 9.
This should be intuitively obvious when you consider that
This is an interesting rule because it leads to a recursive property of divisibility by 9. Notice that the digits of 18 in the preceding example also add up to 9. If we have a larger number like 13,286,025,801 we can repeatedly apply the same rule until we get down to one digit. Only if that single digit is a 9 is the original number (and every digital sum in between) divisible by 9.
For example, the sum of the digits of 13,286,025,801 is:
1 + 3 + 2 + 8 + 6+ 0 + 2 + 5 + 8 + 0 + 1 = 36
and the sum of the digits of 36 is:
and the sum of the digits of 36 is:
3 + 6 = 9
This process of repeatedly summing the digits of a number until you're left with a single digit is called finding the number's digital root. If the digital root of a number is 9, then that number is divisible by 9.
For small numbers like the ones above it's easy to just do long division to see if a number is evenly divisible by 9, but for extremely large numbers with hundreds of digits, division can be quite time consuming. For example, can you tell me if
153,441,702,921,204,324,780,111,405,711,
801,641,412,504,117,621,135,207,441,603,
126,450,890,010,720,810,243,171,423,583,
110,999,306,450,902,232,414,027,522,126,
087,102,603,909,333,306,252,412,702,011
801,641,412,504,117,621,135,207,441,603,
126,450,890,010,720,810,243,171,423,583,
110,999,306,450,902,232,414,027,522,126,
087,102,603,909,333,306,252,412,702,011
is divisible by 9? You might be awhile if you try to solve this using long division. I can tell you that this number is divisible by 9, but before you add up all the digits, let me show you a shortcut called "casting out nines." Let's first try it out on the following example, which is a little bit more manageable
1,729,254,036
Start off adding from the left as normal, and for each digit you add, keep a running total.
When you reach a total greater than 9, as I have here after the third digit, "cast out" a 9 from the total by simply subtracting 9 from it. In this case our running total of 10 becomes 1.
Start off adding from the left as normal, and for each digit you add, keep a running total.
1 + 7 = 8
8 + 2 = 10
When you reach a total greater than 9, as I have here after the third digit, "cast out" a 9 from the total by simply subtracting 9 from it. In this case our running total of 10 becomes 1.
1 + 9 = 10 (-9 = 1)
1 + 2 = 3
3 + 5 = 8
8 + 4 = 12 (-9 = 3)
3 + 0 = 3
3 + 3 = 6
6 + 6 = 12 (-9 = 3)
If the final total isn't 9 (or 0 after casting out that final 9) then the number is not divisible by 9. Since we were left with a remainder of 3, we now know that 1,729,254,036 is not divisible by 9.
An even quicker method of casting out nines is by grouping the digits that add up to 9 and eliminating them. The sum
Why does the divisibility test even work?If the final total isn't 9 (or 0 after casting out that final 9) then the number is not divisible by 9. Since we were left with a remainder of 3, we now know that 1,729,254,036 is not divisible by 9.
An even quicker method of casting out nines is by grouping the digits that add up to 9 and eliminating them. The sum
1 + 7 + 2 + 9 + 2 + 5 + 4 + 0 + 3 + 6
is much easier to reduce if you group it by digits that add up to 9.
is much easier to reduce if you group it by digits that add up to 9.
1 + (7 + 2) + (9) + 2 + (5 + 4) + 0 + (3 + 6)
You can cast out these nines at this step before you do any addition at all.
You can cast out these nines at this step before you do any addition at all.
1 + (0) + (0) + 2 + (0) + 0 + (0)
1 + 2 = 3
You can repeat the grouping and casting process as many times as you need before summing the remaining digits.
Now that you know these shortcuts, take a closer look at that monstrous 150-digit number that I showed you earlier. Using the grouping and casting method it shouldn't take more than a moment to reduce even that large a number to see that it is divisible by 9.
1 + 2 = 3
You can repeat the grouping and casting process as many times as you need before summing the remaining digits.
Now that you know these shortcuts, take a closer look at that monstrous 150-digit number that I showed you earlier. Using the grouping and casting method it shouldn't take more than a moment to reduce even that large a number to see that it is divisible by 9.
To understand why the test for divisibility by 9 works, we need to use a few properties of congruences. Let's start with the fact that
10 ≡ 1 (mod 9)
which in English says that 10 is congruent to 1 modulus 9, or in plain English that 10 and 1 both leave the same remainder (sometimes called the residue) when divided by 9. (In fact, if the right-hand side of the congruence, in this case 1, is less than the modulus, then the right-hand side is the remainder when the left-hand side is divided by the modulus.) In general,
b ≡ c (mod n)
says that the difference between b and c is evenly divisible by n.
One algebraic property of congruences says that we can raise both sides of the congruence to the same power and the modulus will stay the same (this can be more generally stated as P(a) ≡ P(b) (mod n), where P(x) is any polynomial). Using this property we can say that
102 ≡ 12 (mod 9)
or
100 ≡ 1 (mod 9)
You can substitute any non-negative whole exponent you like.
100 ≡ 10 (mod 9)
101 ≡ 11 (mod 9)
102 ≡ 12 (mod 9)
103 ≡ 13 (mod 9)
103 ≡ 13 (mod 9)
...
10n ≡ 1n (mod 9)
So 10 raised to any natural exponent will leave a remainder of 1 when divided by 9.
10n ≡ 1 (mod 9)
This should be intuitively obvious when you consider that
103 - 1 = 1,000 - 1 = 999 is evenly divisible by 9
104 - 1 = 10,000 - 1 = 9,999 is evenly divisible by 9
105 - 1 = 100,000 - 1 = 99,999 is evenly divisible by 9
...
Another property of congruences says that we can multiply both sides by the same number and the congruence remains unchanged. So starting back at
we can multiply both sides by any number and still have a valid congruence.
Starting from the following statements (that we showed to be true above)
we can multiply both sides of each congruence by any number we like.
is the same as
10 ≡ 1 (mod 9)
we can multiply both sides by any number and still have a valid congruence.
10 * 2 ≡ 1 * 2 (mod 9)
20 ≡ 2 (mod 9)
20 ≡ 2 (mod 9)
10 * 5 ≡ 1 * 5 (mod 9)
50 ≡ 5 (mod 9)
50 ≡ 5 (mod 9)
10 * 8 ≡ 1 * 8 (mod 9)
80 ≡ 8 (mod 9)
80 ≡ 8 (mod 9)
Starting from the following statements (that we showed to be true above)
1000 ≡ 1 (mod 9)
100 ≡ 1 (mod 9)
10 ≡ 1 (mod 9)
1 ≡ 1 (mod 9)
we can multiply both sides of each congruence by any number we like.
1000 * 3 ≡ 1 * 3 (mod 9)
100 * 6 ≡ 1 * 6 (mod 9)
10 * 4 ≡ 1 * 4 (mod 9)
1 * 5 ≡ 1 * 5 (mod 9)
is the same as
3000 ≡ 3 (mod 9)
600 ≡ 6 (mod 9)
40 ≡ 4 (mod 9)
5 ≡ 5 (mod 9)
We can add congruences together as long as they have the same modulus. Adding the four congruences above we get
We can add congruences together as long as they have the same modulus. Adding the four congruences above we get
3000 + 600 + 40 + 5 ≡ 3 + 6 + 4 + 5 (mod 9)
or
Doesn't that look like it says that 3645 is congruent to the sum of its own digits modulo 9? Yes, in fact, it does. I deliberately chose the numbers 3, 6, 4, and 5 so that we would arrive back at a familiar example (from the first paragraph of this post), but I could have chosen any digits I wanted. This relationship holds true for any natural number. If s is the sum of the digits of n, then n is congruent to s modulo 9.
But we're only really concerned with the cases where the sum of the digits is evenly divisible by 9. Another way of stating this is
This brings us to the last algebraic property of congruences that we need to use (I promise, this is the last one). Remember that the transitive property of regular arithmetic says that if a = b and b = c, then a = c. The transitive property of congruences is similar. It says that if
and
then
This is simply saying that if a and b leave the same remainder when divided by n, and b and c leave the same remainder when divided by n, then a and c must also leave the same remainder when divided by n. For a concrete example, consider that
so that
(They all leave a remainder of 4.)
Since we've already shown that in the general case
and we know that in the particular cases we're concerned with that the sum of the digits is evenly divisible by 9, or
we can say that in those cases
This means that in those cases where the sum of the digits of n is divisible by 9, the number n itself is also divisible by 9. Precisely what we set out to prove.
or
3645 ≡ 3 + 6 + 4 + 5 (mod 9)
Doesn't that look like it says that 3645 is congruent to the sum of its own digits modulo 9? Yes, in fact, it does. I deliberately chose the numbers 3, 6, 4, and 5 so that we would arrive back at a familiar example (from the first paragraph of this post), but I could have chosen any digits I wanted. This relationship holds true for any natural number. If s is the sum of the digits of n, then n is congruent to s modulo 9.
n ≡ s (mod 9)
But we're only really concerned with the cases where the sum of the digits is evenly divisible by 9. Another way of stating this is
s ≡ 0 (mod 9)
This brings us to the last algebraic property of congruences that we need to use (I promise, this is the last one). Remember that the transitive property of regular arithmetic says that if a = b and b = c, then a = c. The transitive property of congruences is similar. It says that if
a ≡ b (mod n)
and
b ≡ c (mod n)
then
a ≡ c (mod n)
This is simply saying that if a and b leave the same remainder when divided by n, and b and c leave the same remainder when divided by n, then a and c must also leave the same remainder when divided by n. For a concrete example, consider that
32 ≡ 18 (mod 7) and 18 ≡ 11 (mod 7)
so that
32 ≡ 11 (mod 7)
(They all leave a remainder of 4.)
Since we've already shown that in the general case
n ≡ s (mod 9)
and we know that in the particular cases we're concerned with that the sum of the digits is evenly divisible by 9, or
s ≡ 0 (mod 9)
we can say that in those cases
n ≡ 0 (mod 9)
This means that in those cases where the sum of the digits of n is divisible by 9, the number n itself is also divisible by 9. Precisely what we set out to prove.
Subscribe to:
Posts (Atom)