Associated Topics || Dr. Math Home || Search Dr. Math

### Why Casting Out Nines Works

```Date: 10/13/2008 at 17:19:51
From: Las
Subject: Why Casting Out Nines Works

Hello.  I have to do a math project for school, and one of the things
I must know is why the method of "casting out nines" works.  I know
it has to do with modular arithmetic but can you please explain the
math behind this method AS SIMPLY AS POSSIBLE.  I would like it if
you could explain it in simple terms, not college math.  NOTE: I know
how to do this method, so please do not include that with your
response.

I cannot find any place that clearly defines why this method works to
me, because I don't understand what the web site is trying to say.

I have tried reading about modular arithmetic but that is only part
of the reason why this works and I really need someone to explain it
loud and clear to me.

```

```
Date: 10/14/2008 at 11:50:42
From: Doctor Peterson
Subject: Re: Why Casting Out Nines Works

Hi, Las.

Modular arithmetic provides a language in which it is easy to explain
what is happening; without that language, it will take more words to
make it clear (and even more if I wanted to give a complete proof),
but it can be done.  The basic idea of modular arithmetic is that two
numbers are congruent modulo 9 when they leave the same remainders on
division by 9; you'll be seeing phrases like that all through what I
write here!

Let's take a simple example; I'll check the addition 157 + 246.  This
way we can avoid using a lot of variables, but you can follow the
ideas and see that they apply to any number.  (This is how people
talked about algebra before they had the idea of variables, so I'm

The check digit for 157 is 1+5+7 = 13, 1+3 = 4; and the check digit
for 246 is 2+4+6 = 12, 1+2 = 3.  The first thing to ask is, what do
these numbers mean?

The answer is, the check digit gives the remainder when you divide by
9.  In our example, when you divide 157 by 9 you get 17 with a
remainder of 4 (our check digit), and when you divide 246 by 9 you
get 27 with remainder 3 (again our check digit).

Why is that?  What can adding the digits of a number have to do with
dividing and getting a remainder?

Well, let's look at 157, which we can write as 1*100 + 5*10 + 7.
Notice that 10 = 9+1 and 100 = 99+1; any power of ten is 1 more than a
multiple of 9, and therefore will leave a remainder of 1 when divided
by 9.  So we can rewrite 157 as

157 = 1*100 + 5*10 + 7 = 1(99 + 1) + 5(9 + 1) + 7
= (1*99 + 5*9) + (1 + 5 + 7)

Since the first part is a multiple of 9, the second part (the sum of
the digits) will have the same remainder; whatever remainder you get
when you divide 1+5+7 by 9 is the remainder when you divide 157 by 9.

So we can repeat the process with 1+5+7 = 12, adding its digits and
again getting the same remainder.  Once we get this down to one digit,
it IS the remainder.

So what have we learned?  The check digits are remainders; now we have
to consider what happens to remainders when you add numbers. This will
take more of the same kind of thinking.

Take our two numbers, 157 = 9*17 + 4 and 246 = 9*27 + 3.  I've written
each as a multiple of 9 plus its remainder (which is its check digit).

157 + 246 = (9*17 + 4) + (9*27 + 3)
= (9*17 + 9*27) + (4 + 3)
= 9*(17 + 27) + (4 + 3)

So the remainder when you divide the sum by 9 is the sum of the
remainders, 4+3 = 7.  Well, not always--if the sum of the remainders
had been greater than 9, you'd have to divide by 9 again and take the
final remainder.  But in all cases the remainder of the sum is the
same as THE REMAINDER OF the sum of the remainders.  This is where the
language of modular arithmetic saves a lot of words!

This means that the check digit for the sum is the same as the check
digit for the sum of the check digits--and that is what casting out
nines is.  If you find that this is not true, you know that the sum is
incorrect.

Here is an attempt I made once before to explain this in even simpler
terms:

Casting Out Nines for 2nd Graders
http://mathforum.org/library/drmath/view/65299.html

If you have any further questions, feel free to write back.

- Doctor Peterson, The Math Forum
http://mathforum.org/dr.math/

```

```
Date: 10/15/2008 at 20:33:17
From: Las
Subject: Thank you (Why Casting Out Nines Works)

Thank you so very much.  This was the most helpful thing any web site
did for me.  I have a feeling I'm going to get a 100 on this math
project!  Thanks again for taking your time to help me out.  Without
you, I wouldn't understand this.

```

```
Date: 10/15/2008 at 22:44:58
From: Doctor Peterson
Subject: Re: Thank you (Why Casting Out Nines Works)

Hi, Las.

I've been wanting a chance to explain this in simple language, so I

Since you mention this being for a project, I'll just remind you of

http://mathforum.org/announce/terms.html

That includes a helpful link on how to avoid plagiarism; just make
sure that anything close to a quote refers to us as the source.  In
fact, if you just use these ideas as the basis for an explanation that
is entirely your own, we wouldn't mind being mentioned!

- Doctor Peterson, The Math Forum
http://mathforum.org/dr.math/
```
Associated Topics:
Elementary Multiplication
High School Number Theory

Search the Dr. Math Library:

 Find items containing (put spaces between keywords):   Click only once for faster results: [ Choose "whole words" when searching for a word like age.] all keywords, in any order at least one, that exact phrase parts of words whole words

Submit your own question to Dr. Math
Math Forum Home || Math Library || Quick Reference || Math Forum Search