Showing posts with label divisibility. Show all posts
Showing posts with label divisibility. Show all posts

Monday, 30 May 2011

Divisibility Tests for 7,13,17 & 19

Divisibility test of 7
1).Double the last digit (digit at the rightmost place) and subtract it from the number left (excluding the last digit). If this number is divisible with 7 then the original number is divisible by 7.
This procedure can be followed as many times as required (until the number is reduced to 2 digit number). Then the number so obtained can be checked whether it is divisible by 7 or not. If the number so obtained is divisible by 7 then the original number is divisible by 7 and if not then original number is not divisible by 7.
E.g.-
Consider the number 1057.
Now the last digit is 7. On doubling it we get 14.
On subtracting it from 105 we get 91.
Now it can be seen that 91 is divisible by 7 so the original number is divisible by 7.
(It can further be simplified by doubling 1 and subtracting it from 9 and thus we get 7 which is divisible by7.)
——————XXXXXXXX———-
Divisibility test of 13
To check whether a number is divisible by 13 we follow the procedure as follows:
1). Multiply the last digit with 4 and add it to the number left (after removing the last digit).
2). Follow this method again and again and reduce the number to 2-digit number form.
3). Now check whether the number is divisible by 13 or not.
If the 2-digit number so obtained is divisible by 13 then the original number is divisible by 13 otherwise not.
E.g.-
Let us consider the number 195.
Now the last digit is 5 and on multiplying it with 4 we get 20.
Now on adding this with the remaining number (i.e. 19) we get 39. Now as 39 is divisible by 13 therefore the original
number id divisible by 13.
———————XXXXXXXXXXX————
Divisibility test of 17
To check whether a number is divisible by 17 we follow the procedure as follows:
1). Multiply the last digit with 5 and subtract it from the number left (after removing the last digit).
2). Follow this method again and again and reduce the number to 2-digit number form.
3). Now check whether the number is divisible by 17 or not.
If the 2-digit number so obtained is divisible by 17 then the original number is divisible by 17 otherwise not.
E.g.-
Let us consider the number 221.
Now the last digit is 1 and on multiplying it with 5 we get 5.
Now on subtracting 5 from the remaining number (i.e. 22) we get 17. Now as 17 is divisible by 17 therefore the original number id divisible by 17.
——————XXXXXXXXXX——————–
Divisibility test of 19
To check whether a number is divisible by 19 we follow the procedure as follows:
1). Multiply the last digit with 2 and add it to the number left (after removing the last digit).
2). Follow this method again and again and reduce the number to 2-digit number form.
3). Now check whether the number is divisible by 19 or not.
If the 2-digit number so obtained is divisible by 19 then the original number is divisible by 19 otherwise not.
E.g.-
Let us consider the number 209.
Now the last digit is 9 and on multiplying it with 2 we get 18.
Now on adding th18 with the remaining number(i.e. 20) we get 38. Now as 38 is divisible by 19 therefore the original number id divisible by 19.
Number Multiply last digit -/+
7 2 -
13 4 +
17 5 -
19 2 +

Friday, 27 November 2009

Divisibility tests

A number is divisible by 2 if its last digit is also (i.e. 0,2,4,6 or 8).
A number is divisible by 3 if the sum of its digits is also. Example: 534: 5+3+4=12 and 1+2=3 so 534 is divisible by 3.
A number is divisible by 5 if the last digit is 5 or 0.
Most people know (only) those 3 rules. Here are my rules for divisibility by the PRIMES up to 50. Why only primes and not also composite numbers? A number is divisible by a composite if it is also divisible by all the prime factors (e.g. is divisible by 21 if divisible by 3 AND by 7). Small numbers are used in these worked examples, so you could have used a pocket calculator. But my rules apply to any number of digits, whereas you cannot test a 30 or more digit number on your pocket calculator otherwise.
Test for divisibility by 7. Double the last digit and subtract it from the remaining leading truncated number. If the result is divisible by 7, then so was the original number. Apply this rule over and over again as necessary. Example: 826. Twice 6 is 12. So take 12 from the truncated 82. Now 82-12=70. This is divisible by 7, so 826 is divisible by 7 also.
There are similar rules for the remaining primes under 40, i.e. 11,13, 17,19,23,29,31,37,41,43 and 47.
Test for divisibility by 11. Subtract the last digit from the remaining leading truncated number. If the result is divisible by 11, then so was the first number. Apply this rule over and over again as necessary.
Example: 19151--> 1915-1 =1914 -->191-4=187 -->18-7=11, so yes, 19151 is divisible by 11.
Test for divisibility by 13. Add four times the last digit to the remaining leading truncated number. If the result is divisible by 13, then so was the first number. Apply this rule over and over again as necessary.
Example: 50661-->5066+4=5070-->507+0=507-->50+28=78 and 78 is 6*13, so 50661 is divisible by 13.
Test for divisibility by 17. Subtract five times the last digit from the remaining leading truncated number. If the result is divisible by 17, then so was the first number. Apply this rule over and over again as necessary.
Example: 3978-->397-5*8=357-->35-5*7=0. So 3978 is divisible by 17.
Test for divisibility by 19. Add two times the last digit to the remaining leading truncated number. If the result is divisible by 19, then so was the first number. Apply this rule over and over again as necessary.
EG: 101156-->10115+2*6=10127-->1012+2*7=1026-->102+2*6=114 and 114=6*19, so 101156 is divisible by 19.
My original divisibilty webpage stopped here. However, I have had a number of mails asking for divisibility tests for larger primes, so I've extended the list up to 50. Actually even with 37 most people cannot do the necessary mental arithmetic easily, because they cannot recognise even single-digit multiples of two-digit numbers on sight. People are no longer taught the multiplication table up to 20*20 as I was as a child. Nowadays we are lucky if they know it up to 10*10.
Test for divisibility by 23. Add seven times the last digit to the remaining leading truncated number. If the result is divisible by 23, then so was the first number. Apply this rule over and over again as necessary.
Example: 17043-->1704+7*3=1725-->172+7*5=207-->20+7*7=69 which is 3*23, so 17043 is also divisible by 23.
Test for divisibility by 29. Add three times the last digit to the remaining leading truncated number. If the result is divisible by 29, then so was the first number. Apply this rule over and over again as necessary.
Example: 15689-->1568+3*9=1595-->159+3*5=174-->17+3*4=29, so 15689 is also divisible by 29.
Test for divisibility by 31. Subtract three times the last digit from the remaining leading truncated number. If the result is divisible by 31, then so was the first number. Apply this rule over and over again as necessary.
Example: 7998-->799-3*8=775-->77-3*5=62 which is twice 31, so 7998 is also divisible by 31.
Test for divisibility by 37. This is (slightly) more difficult, since it perforce uses a double-digit multiplier, namely eleven. People can usually do single digit multiples of 11, so we can use the same technique still. Subtract eleven times the last digit from the remaining leading truncated number. If the result is divisible by 37, then so was the first number. Apply this rule over and over again as necessary.
Example: 23384-->2338-11*4=2294-->229-11*4=185 which is five times 37, so 23384 is also divisible by 37.
Test for divisibility by 41. Subtract four times the last digit from the remaining leading truncated number. If the result is divisible by 41, then so was the first number. Apply this rule over and over again as necessary.
Example: 30873-->3087-4*3=3075-->307-4*5=287-->28-4*7=0, remainder is zero and so 30873 is also divisible by 41.
Test for divisibility by 43. Now it starts to get really difficult for most people, because the multiplier to be used is 13, and most people cannot recognise even single digit multiples of 13 at sight. You may want to make a little list of 13*N first. Nevertheless, for the sake of completeness, we will use the same method. Add thirteen times the last digit to the remaining leading truncated number. If the result is divisible by 43, then so was the first number. Apply this rule over and over again as necessary.
Example: 3182-->318+13*2=344-->34+13*4=86 which is recognisably twice 43, and so 3182 is also divisible by 43.
Update : Bill Malloy has pointed out that, since we are working to modulo43, instead of adding factor 13 times the last digit, we can subtract 30 times it, because 13+30=43. Why didn't I think of that!!! :-(
Finally, the Test for divisibility by 47. This too is difficult for most people, because the multiplier to be used is 14, and most people cannot recognise even single digit multiples of 14 at sight. You may want to make a little list of 14*N first. Nevertheless, for the sake of completeness, we will use the same method. Subtract fourteen times the last digit from the remaining leading truncated number. If the result is divisible by 47, then so was the first number. Apply this rule over and over again as necessary.
Example: 34827-->3482-14*7=3384-->338-14*4=282-->28-14*2=0 , remainder is zero and so 34827 is divisible by 47.
I've stopped here at the last prime below 50, for arbitrary but pragmatic reasons as explained above.
Other blogreaders (sadly even people from .edu domains, who should be able to do the elementary algebra themselves) have asked why I sometimes say ADD and for other primes say SUBTRACT, and ask where the apparently arbitrary factors come from. So let us do some algebra to show the method in my madness.
We have displayed the recursive divisibility test of number N as f-M*r where f are the front digits of N, r is the rear digit of N and M is some multiplier. And we want to see if N is divisible by some prime P. We need a method to work out the values of M. What you do is to calculate (mentally) the smallest multiple of P which ends in a 9 or a 1. If it's a 9 we are going to ADD, if it's a 1 we are going to SUBTRACT later. Then we will use the leading digit(s) of the multiple as our multiplier M.
Example for P=17 : three times 17 is 51 which is the smallest multiple of 17 that ends in a 1 or 9. Since it's a 1 we are going to SUBTRACT later. The leading digit is a 5, so we are going to SUBTRACT five times the remainder r. The algorithm was stated above. Now let's do the algebraic proof. Writing N=10f+r, we can multiply by -5 (as shown in the example for 17), getting -5N=-50f-5r. Now we add 51f to both sides (because 51 was the smallest multiple of P=17 to end in a 1 or a 9), giving one f (which we want), so 51f-5N=f-5r. Now if N is divisible by P (here P=17), we can substitute to get 51f-5*17*x=f-5r and rearrange the left side as 17*(3f-5x)=f-5r and therefore f-5r is a multiple of P=17 also. Q.E.D.

Special numbers

A number of 9 digits has the following properties:

  • The number comprising the leftmost two digits is divisible by 2, that comprising the leftmost three digits is divisible by 3, the leftmost four by 4, the leftmost five by 5, and so on for the nine digits of the number i.e. the number formed from the first n digits is divisible by n, 2<=n<=9.

  • Each digit in the number is different i.e. no digits are repeated.
  • The digit 0 does not occur in the number i.e. it is comprised only of the digits 1-9 in some order.
Find the number.

Answer
The answer is 381654729 One way to solve it is Trial-&-Error. You can make it bit easier as odd positions will always occupy ODD numbers and even positions will always occupy EVEN numbers. Further 5th position will contain 5 as 0 does not occur.
At odd points we have  3 1 5 7 9
At even points we have 8 6 4 2