Verify that ## N-M ## is divisible by ## 9 ##

  • Thread starter Math100
  • Start date
In summary: Inevitably, they say yes. They are usually surprised when I tell them that this will always be the case, and then explain why.In summary, given an integer ## N ##, let ## M ## be the integer formed by reversing the order of the digits of ## N ##. The difference between ## N ## and ## M ##, denoted by ## N-M ##, is divisible by ## 9 ##. This can be shown by writing the decimal expansions of ## N ## and ## M ##, and using the fact that ## 10^n \equiv 1 \pmod {9} ##, which implies ## 9 \mid (10^n - 1) ##.
  • #1
Math100
756
202
Homework Statement
Given an integer ## N ##, let ## M ## be the integer formed by reversing the order of the digits of ## N ## (for example, if ## N=6923 ##, then ## M=3296 ##). Verify that ## N-M ## is divisible by ## 9 ##.
Relevant Equations
None.
Proof:

Suppose ## N=a_{m}10^{m}+\dotsb +a_{2}10^{2}+a_{1}10+a_{0} ##, where ## 0\leq a_{k}\leq 9 ##, be the decimal
expansion of a positive integer ## N ##.
Let ## M=a_{0}10^{m}+\dotsb +a_{m-2}10^{2}+a_{m-1}10+a_{m} ##, where ## 0\leq a_{q}\leq 9 ##, be the
decimal expansion of a positive integer ## M ##.
Then ## N-M=(a_{m}-a_{0})10^{m}+\dotsb +(a_{2}-a_{m-2})10^{2}+(a_{1}-a_{m-1})10+(a_{0}-a_{m}) ##.
Observe that ## 10\equiv 1\pmod {9}\implies 10^{n}\equiv 1\pmod {9} ##.
This means ## 9\mid (10^{n}-1) ##.
Thus ## 9\mid (N-M) ##.
Therefore, ## N-M ## is divisible by ## 9 ##.
 
Physics news on Phys.org
  • #2
Math100 said:
Homework Statement:: Given an integer ## N ##, let ## M ## be the integer formed by reversing the order of the digits of ## N ## (for example, if ## N=6923 ##, then ## M=3296 ##). Verify that ## N-M ## is divisible by ## 9 ##.
Relevant Equations:: None.

Proof:

Suppose ## N=a_{m}10^{m}+\dotsb +a_{2}10^{2}+a_{1}10+a_{0} ##, where ## 0\leq a_{k}\leq 9 ##, be the decimal
expansion of a positive integer ## N ##.
Let ## M=a_{0}10^{m}+\dotsb +a_{m-2}10^{2}+a_{m-1}10+a_{m} ##, where ## 0\leq a_{q}\leq 9 ##, be the
decimal expansion of a positive integer ## M ##.
Then ## N-M=(a_{m}-a_{0})10^{m}+\dotsb +(a_{2}-a_{m-2})10^{2}+(a_{1}-a_{m-1})10+(a_{0}-a_{m}) ##.
Observe that ## 10\equiv 1\pmod {9}\implies 10^{n}\equiv 1\pmod {9} ##.
This means ## 9\mid (10^{n}-1) ##.
Thus ## 9\mid (N-M) ##.
How?

We have
\begin{align*}
N-M&=(a_{m}-a_{0})10^{m}+\dotsb +(a_{2}-a_{m-2})10^{2}+\ldots +(a_{1}-a_{m-1})10+(a_{0}-a_{m})\\
&\equiv (a_{m}-a_{0})+(a_{m-1}-a_1)+ \dotsb +(a_{2}-a_{m-2}) +(a_{1}-a_{m-1})+(a_{0}-a_{m}) \pmod 9\\
&\equiv 0 \pmod 9
\end{align*}
Math100 said:
Therefore, ## N-M ## is divisible by ## 9 ##.
Sorry, haven't seen it without the extra line.
 
  • Like
Likes Delta2 and Math100
  • #3
I think this is true if you permute any two ( even number?) of digits of the original number.
This is, iirc, a trick used often by accountants: If your final result is a sum is wrong by a multiple of 9, then you flipped your digits in one of the summands.
 
  • Like
Likes pbuk
  • #4
WWGD said:
I think this is true if you permute any two ( even number?) of digits of the original number.
Any permutation will do.

WWGD said:
This is, iirc, a trick used often by accountants
Not so much any more, not sure if they even teach it these days... kids of today... bah, humbug...
 
  • Like
Likes Delta2 and WWGD
  • #5
fresh_42 said:
How?

We have
\begin{align*}
N-M&=(a_{m}-a_{0})10^{m}+\dotsb +(a_{2}-a_{m-2})10^{2}+\ldots +(a_{1}-a_{m-1})10+(a_{0}-a_{m})\\
&\equiv (a_{m}-a_{0})+(a_{m-1}-a_1)+ \dotsb +(a_{2}-a_{m-2}) +(a_{1}-a_{m-1})+(a_{0}-a_{m}) \pmod 9\\
&\equiv 0 \pmod 9
\end{align*}

Sorry, haven't seen it without the extra line.
I can understand your explanation but I can't understand OP: I can't fill in the in between steps, how from ##10^n-1## is a multiple of 9 we derive that N-M is a multiple of 9.
 
  • #6
Delta2 said:
I can understand your explanation but I can't understand OP: I can't fill in the in between steps, how from ##10^n-1## is a multiple of 9 we derive that N-M is a multiple of 9.
Should be ##10^{m-k} - 10^k##, which is what multiplies ##a_k##.
 
  • Like
Likes Delta2
  • #7
Orodruin said:
Should be ##10^{k} - 10^{m-k}##, which is what multiplies ##a_k##.
Or, in the case of a random perturbation ##\sigma## of the digits:
$$
10^k - 10^{\sigma(k)}.
$$
 
  • #8
WWGD said:
This is, iirc, a trick used often by accountants: If your final result is a sum is wrong by a multiple of 9,
I'm not sure that was what it was about. The trick I know of, which is called "casting out 9s", had to do with a check on the total of a longish column of numbers.

For each number in the column, add all the digits repeatedly until you get down to a single digit. For example, 4027 --> 4 + 2 + 7 = 4 + 9 = 13 --> 1 + 3 = 4. We could have skipped a couple steps by noticing that 2 + 7 adds to 9, which can be discarded ("cast out") and replaced with zero if necessary. What this does is to show that ##4027 \equiv 4~\mod 9##.

Do the same operation for each number in the column, essentially writing the modulo 9 equivalence class. Then add all the mod 9 numbers, again repeatedly adding to get a single digit.
Compare this digit to what you get when you add the digits of your earlier sum. If there's a discrepancy, it means you've made a mistake somewhere.

As an example:
4027 --> 4 (work shown above)
3195 --> 0 ( after casting out all 9s we're left only with 0)
6211 --> 1
------ The three numbers above add to 5
13434 --> 6
I've deliberately made a mistake in adding my three numbers to get 13,434, which is equiv. to 6 mod 9. The sum of the equivalence classes of the individual numbers is 5. This tells me that I've made a mistake somewhere.
pbuk said:
Not so much any more, not sure if they even teach it these days...
Yeah, the preference seems to be to give kindergarteners a calculator and call it good.

Regarding the problem of this thread, l've found this to be a good parlor trick to show young kids. I ask them to write down, say, a four-digit number, and then write down any permutation of the original number. I then ask them to subtract whichever number is smaller from the larger one.

I then ask if the result has the same number of digits. If so, I ask them to tell me all but one of the digits, with the caveat that if there are any 0s, those need to be told to me. Coming up with the missing digit is simple if all but one of the digits are known.

I did this with my "8 -3/4 year old" niece last summer, and she really got a kick out of it.
 
  • Like
Likes jim mcnamara

1. How do you verify if a number is divisible by 9?

To verify if a number is divisible by 9, you can use the divisibility rule which states that if the sum of the digits in a number is divisible by 9, then the number itself is divisible by 9.

2. Can you provide an example of using the divisibility rule to verify if a number is divisible by 9?

Yes, for example, let's take the number 135. The sum of its digits is 1+3+5=9, which is divisible by 9. Therefore, we can conclude that 135 is also divisible by 9.

3. Is there any other way to verify if a number is divisible by 9?

Yes, another way is to divide the number by 9 and check if the remainder is 0. If the remainder is 0, then the number is divisible by 9.

4. Can you explain why the divisibility rule for 9 works?

The divisibility rule for 9 works because 9 is one less than 10, which is the base of our number system. This means that when we divide a number by 9, we are essentially dividing it by 10 and then subtracting 1 from the quotient. So, if the sum of the digits is divisible by 9, it means that the original number is also divisible by 9.

5. How can verifying if a number is divisible by 9 be useful in scientific research?

Verifying if a number is divisible by 9 can be useful in scientific research when dealing with large data sets or performing calculations. It can help in identifying patterns or errors in the data, and also in simplifying calculations by reducing the number of digits to work with.

Similar threads

  • Precalculus Mathematics Homework Help
Replies
2
Views
932
  • Precalculus Mathematics Homework Help
Replies
3
Views
1K
  • Precalculus Mathematics Homework Help
Replies
1
Views
818
  • Precalculus Mathematics Homework Help
Replies
5
Views
1K
  • Precalculus Mathematics Homework Help
Replies
6
Views
1K
  • Precalculus Mathematics Homework Help
Replies
6
Views
1K
  • Precalculus Mathematics Homework Help
Replies
3
Views
676
  • Precalculus Mathematics Homework Help
Replies
3
Views
804
  • Precalculus Mathematics Homework Help
Replies
7
Views
1K
  • Precalculus Mathematics Homework Help
Replies
1
Views
740
Back
Top