If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

The why of the 3 divisibility rule

Why you can add the digits to see if something is divisible by 3. Created by Sal Khan.

Want to join the conversation?

  • leaf green style avatar for user FinallyGoodAtMath
    Why doesn't this work with other numbers? Why can't I add all the digits to see if it's divisible by 4?
    (210 votes)
    Default Khan Academy avatar avatar for user
    • leafers sapling style avatar for user Peter Collingridge
      It will only work with numbers that are factors of 9 (i.e. 3 and 9). The reason is that every time you go above 10, you increase the value in the tens column by 1, and decrease the value of the units by 10. The net result is that the sum of the digits decreases by 9. So it works with 3, because when you get to 12, the sum of the digits is 12-9 or 3 (which is divisible by 3). But it doesn't work with 4 because when you get to 12, you subtract 9, which isn't a multiple of 4.

      However this does means that if you were to use base 9, you would be able to use this trick on numbers divisible by 8 (i.e. 2, 4 and 8). If you use base 16, the trick works for factors of 15 (i.e. 3, 5 and 15).

      For more divisibility rules see:http://www.khanacademy.org/math/arithmetic/factors-multiples/v/recognizing-divisibility

      Hope that makes some sense.
      (285 votes)
  • male robot hal style avatar for user Jun Nyang
    Are there any other "tricks" for numbers other than three?
    (49 votes)
    Default Khan Academy avatar avatar for user
    • male robot hal style avatar for user CamdenMounts
      To test divisibility by 2, the last digit must be even.
      To test divisibility by 3, the sum of the digits must be a multiple of 3
      TTDB 4, the last two digits must be a multiple of 4 OR the last two digits are 00.
      TTDB 5, the last digit must be either a 5 OR 0.
      TTDB 6, the sum of the digits must be a multiple of 3.
      TTDB 7, take the last digit and double it. Then subtract your answer from the sum of the other digits. If this new answer is a multiple of 7, then the original number must be also.
      TTDB 8, the last 3 digits must be either 000 OR a multiple of 8.
      TTDB 9, check if the sum of the digits is a multiple of 9.
      For 10, it must end with a 0.

      To acknowledge everyone's posts below, TTDB N, the number must divide evenly by all of N's factors.
      (164 votes)
  • male robot hal style avatar for user rchakrjr
    Is there a divisibility rule for 7? It's the only number which stumps me.
    (42 votes)
    Default Khan Academy avatar avatar for user
    • male robot hal style avatar for user 전동우
      me again i looked it up and OMG it's confusing i hope you'll understand it :) here goes nothing let's see if the number 60172 is divisable by 7, you 'delete' the 1st digte. 60172->6017 got it? then multiply the number you just deleted( the number 2) by 2 then subtract it from the number you got(the number 6017) we're on the same page yes? ok so 6017-4 rite? =6013 you repete the process untill you get to a 2digte or 1 digte number. 6013->601 then subration 601-3x2(6)= 595
      (36 votes)
  • leaf blue style avatar for user Emily
    Does this divisibility apply to negative numbers?
    (19 votes)
    Default Khan Academy avatar avatar for user
  • spunky sam blue style avatar for user Samir Gunic
    Is this principle the same for 6 and 9, i.e. multiples of 3?
    (15 votes)
    Default Khan Academy avatar avatar for user
  • purple pi purple style avatar for user light runner
    Does the trick for three and nine work for eighty-one? Since nine is a factor of eighty-one.
    (7 votes)
    Default Khan Academy avatar avatar for user
  • aqualine tree style avatar for user Nikki Ranjit
    Sal confused me when he said 9x9. I know he didn't mean to say that but it confused me so is there someone who can explain it to me?
    (4 votes)
    Default Khan Academy avatar avatar for user
  • aqualine tree style avatar for user Varsha
    This may be a proof of the divisibility rule for 3.
    Given a number written in standard notation as xyz, where x,y, and z are integers, and xyz is actually 100x+10y+(1)z, prove that if (x+y+z)mod 3 = 0 (which means it is divisible by 3), then (xyz)mod 3 = 0.

    1) if (x+y+z) mod 3 = 0 then (xyz) mod 3 = 0 (=> what we're trying to prove)
    2) if (x+y+z) mod 3 = 0 then (100x+10y+z) mod 3 = 0 (=> rewrite (xyz) as 100x+10y+z).
    3) If (x+y+z) mod 3 = 0 then [(100x mod 3)+ (10y mod 3) + (1)z mod 3]mod 3 = 0. (=> rewrite using the distributive property of modulo, which states that - (a+b)mod n = [(a mod n) + (b mod n)]mod n).
    4) If (x + y + z) mod 3 = 0, then [(100 mod 3)(x mod 3)+(10 mod 3)(y mod 3)+ (1 mod 3)(z mod 3]mod 3 = 0 (=> use the distributive property of modulo, which states that - a*b mod n = [(a mod n)*(b mod n)]mod n
    5) We know 100 mod 3 is 1, and 10 mod 3 is 1, and 1 mod 3 is 1 so we reduce the above to -
    If (x+y+z)mod 3 = 0, then [(1)x mod 3 + (1)y mod 3 + (1)z mod 3]mod 3 = 0.
    6) We use the reverse of the distributive property of modulo, which is that [a mod n + b mod n]mod n = (a+b) mod n to write:
    If (x+y+z)mod 3 = 0, then (x+y+z)mod 3 = 0.

    VOILA! What this means is that it doesn't have to be just evenly divisible. This means that any remainder of a number of the form xyz divided by 3 will be equal to the remainder of the sum of of x + y + z by 3.

    This can be applied to divisibility rules for 2, 9, 4, etc.

    For 2:

    For a number of the form xyz, where xyz = 100x+10y+z, prove that if z mod 2 = 0 then xyz mod 2 = 0. I'm just going to go through the right hand side if the conditional statement:
    1) (100x+10y+z)mod 2 = 0
    2) [(100x mod 2)+(10y mod 2) + z mod 2]mod 2 = 0 (distributive property of modulo)
    3) {[(100 mod 2)(x mod 2)](mod 2)+[(10 mod 2)(y mod 2)](mod 2)+ z mod 2}mod 2 = 0
    4) We know 100 mod 2 = 0, 10 mod 2 = 0 and so we get:
    {[(0)(x mod 2)]mod 2 + [(0)(y mod 2)]mod 2 + z mod 2}mod 2 = 0.
    5) {(0)mod 2 + (0)mod 2 + z mod 2}mod 2 = 0.
    We know 0 mod 2 = 0, so we get:
    6) (0 + 0 + z mod 2)mod 2 = 0.
    7) (z mod 2)mod 2 = 0
    We just showed that (xyz)mod 2 = 0 is the same as (z mod 2)mod 2 = 0.

    Now if we assume the expression in the if statement, that if z mod 2 = 0, then that statement becomes
    (0)mod 2 = 0, and since 0 mod 2 = 0, we just proved that the divisibility rule for 2 is true.

    WOOOOHOOO!

    This is amazing. Khan Academy just makes math beautiful and so much fun.
    (4 votes)
    Default Khan Academy avatar avatar for user
  • leaf blue style avatar for user Maria Hernandez
    what if the sum of 72 is 7+2 is 9 and you said its divisible by 3...why does it give you the number 8 once it gets divided twice by 3
    (2 votes)
    Default Khan Academy avatar avatar for user
  • piceratops ultimate style avatar for user Kshitij Nair
    does this trick happen with 6?
    like 66,72,54
    (2 votes)
    Default Khan Academy avatar avatar for user

Video transcript

You're just walking down the street and someone comes up to you and says "Quick! Quick!-- 4792. Is this divisible by 3? This is an emergency! Tell me as quickly as possible! And luckily you have a little tool in your toolkit where you know how to test for divisibility by 3 Well, you say I can just add up the digits If the sum of that is a multiple of 3 then this whole thing is a multiple of 3 So you say 4 plus 7 plus 9 plus 2 That's 11. Plus 9, it's 20. Plus 2 is 22 That's not divisible by 3 If you're unsure, you can even add the digits of that 2 plus 2 is 4. Clearly not divisible by 3 So this thing right over here is not divisible by 3 And so luckily that emergency was saved But then you walk down the street a little bit more and someone comes up to you--- "Quick! Quick! Quick! 386,802-- Is that divisible by 3?" Well, you employ the same tactic You say, what's 3 plus 8 plus 6 plus 8 plus 0 plus 2? 3 plus 8 is 11. Plus 6 is 17. Plus 8 is 25. Plus 2 is 27 Well, 27 is divisible by 3 And if you're unsure, you could add these digits right over here 2 plus 7 is equal to 9. Clearly divisible by 3 So this is divisible by 3 as well So now you feel pretty good You've helped two perfect strangers with their emergencies You figured out if these numbers were divisible by 3 very very very very quickly But you have a nagging feeling Because you're not quite sure why that worked You've just kind of always known it And so, let's think about why it worked To think about it, I'll just pick a random number But we could do this really for any number But I don't want to go too puffy on it just so you can see it's pretty common sense here And the number we'll use is 498 I can literally use any number in this situation And to think about why this whole little tool this little system works we just have to rewrite 498 We can rewrite the 4- since it's in the hundred's place we can write that as 4 times 100 Or 4 times 100, that's the same thing as 4 times 1 plus 99 That's all this 4 is 400, which is the same thing as 4 times 100 which is the same thing as 4 times 1 plus 99 And the little trick here is I want to write- instead of writing 100, I want to write this as the sum of 1 plus something that is divisible by 3 And 99 is divisible by 3 If I add more digits here- 999, 9999-- they're all divisible by 3 And this is why you can do the same reasoning for divisibility by 9 Because they are divisible by 9 as well Anyway, that's what the 4 in the hundred's place represents This 9 in the ten's place- well that represents 90 or 9 times 10, or 9 times 1 plus 9 And then finally this 8. That's in the one's place 8 times 1, or we just write plus 8 Now we can distribute this 4 This is 4 times 1 plus 4 times 99. So it's 4 plus 4 times 99 Actually let me write it like this. I'm going to write-- Actually let me write it first like 4 plus 4 times 99 Do the same thing over here This is the same thing as plus 9-- do that magenta color- plus 9 plus 9 times 9 And then finally I have this 8 right over here And I can rearrange everything These terms right over here, the 4 times 99, and the 9 times 9 I can write over here 4 times 99- I'll write what's like a different notation plus the 9 times the 9, that's those two terms and then we have the plus 4 plus 9 plus 8 Well, can we now tell whether this is divisible by 3? These terms, these first two terms are definitely divisible by 3 This's divisible by 3 because 99 is divisible by 3 regardless of what we have already you don't even have to look at this This is divisible by 3, so if you're multiplying it it's still going to be divisible by 3 This is divisible by 3, so if you're multiplying this whole thing it's still going to be divisible by 3 If you add two things that are divisible by 3 the whole thing is going to be divisible by 3 So all of this is divisible by 3 And if you have another digit here, you'd done the same exact thing Instead of having 1 plus 99, you'd had 1 plus 999, 1 plus 9999, etc So the only thing you have to really worry about is this part right over here you have to ask yourself in order for this whole thing to be divisible by 3 this part is- well that part is, then this part in order for the whole thing has to be divisible by 3 that also has to be divisible by 3 But what is this right over here? These are just our original digits 498. 4 and 9 and 8 We just have to make sure that when we take the sum it's divisible by 3