The (almost really) Complete Works of Lewis Carroll

Divisibility by Seven

Source: Knowledge, July 4, 1884

[1324]—Mr. Askew, in 1274, May 30, asks for a proof of a method for ascertaining the divisibility of a number by 7, which he states to have been discovered by Mr. Rickard, of Birmingham. Probably many have discovered it: my father did, for one, and taught it to me some thirty years ago. The test-number is equally useful for 7, 11, and 13. The method, as worked by my father, gives, in the case of a number divisible by all three factors, the other factor as well, without further labour: and in this respect it has an advantage over that of Mr. Rickard.

If a number, N, be marked off from the right-hand end in periods of three digits; and if a, b, c, &., be the periods; and if M be the difference between the sums of the alternate periods; we have, writing r for 1000, N=a+br+cr2+dr3+&c.M=ab+cd+&c.NM=b(r+1)+c(r21)+d(r3+1)+&c. and is divisible by (r+1); hence, if M be divisible by (r+1) or any factor of it, so also is N. And in this case r+1=1001=7×11×13.

8026518423
931095423
924

My father’s rule was to set the right-hand period under the next, and subtract, setting the remainder under the next, and so on. In the last period, the subtraction is downwards if the lower number be the larger. In this instance, since we have 1 to carry into the last period, the 931 must be read as 932. The ultimate remainder, 924, is the test-number; and, since this is divisible by 7 and 11, so also is the whole number.

If the test-number chanced to be zero, the second line would be the quotient produced by dividing the given number by 1001; i. e., it is the factor remaining after dividing out 7, 11, and 13. For let us call the second line “V;” writing three ciphers at the end, we get 1000V; and we know that, if this be deducted from the upper line, the remainder =V. Hence N=1001V=7×11×13×V. In the above example, if the left-hand period were 932 instead of 8, the test-number would be zero.

64372583
05852053

If the periods be single digits, i. e., if r=10, we get a test for divisibility by 11, and at the same time the quotient after dividing out 11. The rule is to set the last digit under the next, and subtract, setting the remainder under the next, and so on. In this instance the test-number =0; hence the given number =11×5852053.

With periods of two digits, we get a test for divisibility by 101; and so for four or more digits.

C. L. Dodgson.
Ch. Ch., Oxford.

P.S.—The sum of all the periods gives us, for periods of 1, 2, 3, &c., digits, a test for divisibility by 9, 99, 999 (=27×37), &c., or for any factors of these numbers. This method may also be worked by a rule analogous to that given above; e. g., to test for 999, mark off in periods of three, write 000 over the right-hand period, and subtract, writing the remainder over the next, and so on. Hence, also, if the test-number chanced to be zero, the upper line (omitting the 000) would be the quotient produced by dividing the given number by 999.

Probably similar rules may be made for most primes. I have myself made fairly simple rules for 17 and for 19; but such processes are rather curious than useful.