Jump to content

User:CaritasUbi/Casting out nines: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Line 174: Line 174:


{{equation|1=s(m \times n)
{{equation|1=s(m \times n)
\equiv s(\sum_{k=0}^\infty 10^k c_k \times \sum_{k=0}^\infty 10^k d_k)
\equiv s(\sum_{k=0}^\infty 10^k c_k \times \sum_{k=0}^\infty 10^k d_k) \mod 9}}

\equiv s(\sum_{k=0}^\infty c_k \times \sum_{k=0}^\infty d_k)
{{equation|1=
\equiv s(s(m) \times s(n))
\equiv s(m) \times s(n) \mod 9
\equiv s(\sum_{k=0}^\infty c_k \times \sum_{k=0}^\infty d_k) \mod 9}}

}}
{{equation|1=
\equiv s(s(m) \times s(n)) \mod 9}}

{{equation|1=
\equiv s(m) \times s(n) \mod 9}}


hence,
hence,
{{equation|1=s(m \times n) = s(m) \times s(n)}}
{{equation|1=s(m \times n) = s(m) \times s(n)}}


which proves part 2 of the theorem.<math>\Box</math>
which proves part 2.<math>\Box</math>

Revision as of 21:18, 4 November 2022

Before the advent of pocket calculators, arithmetic was generally done by hand, and was frequently subject to errors. One technique to quickly verify that a calculation was accurate was called casting out nines.

This meant taking the sum of the digits of a number, subtracting 9 whenever the sum was greater than 9, or, equivalently, taking the sum of the digits and then taking the sum of the digits of that sum, and so on, until sum was less than 9. It was asserted that for any integers x, y, and z, if , the sum of the digits of x plus the sum of the digits of y would always be congruent mod 9 with the sum of the digits of z.

Similarly for multiplication, if , the sum of the digits of x times the sum of the digits of y would always be congruent mod 9 with the sum of the digits of z.

This article develops a rigorous proof of the correctness of that technique.

Definition 1

Define to be a function that maps an integer n to the sum of its digits. That is, for the digits of n (from right to left),

where each of the digits is an integer .

Lemma 1

Lemma 1: Every positive integer is greater than or equal to the sum of its digits.

Proof: Let n be a positive integer with non-negative digits (from right to left) of so that . By induction over the number of digits, we see clearly that for single-digit numbers, . If we can show that the proposition is true for m digit numbers, it must also be true for m + 1 digit numbers, because since , and since every digit is non-negative, so

Hence, the proposition holds for numbers of any number of digits. .

Lemma 2

Lemma 2: Every positive integer is congruent mod 9 to the sum of its digits.

Proof: Let n by a positive integer with non-negative digits (from right to left) so that

(1)

In this case,

(2)

By the definition of congruence,  mod 9 if and only if there is some integer m such that . So  mod 9 if and only if there is some integer m such that .

Now consider

(3)

This means that is an even multiple of 9, hence

 mod 9  .

Lemma 3

Lemma 3: Repeated applications of will eventually yield a single non-negative number less than 9.

Proof: Consider the series {}. Evaluating each adjacent pair of terms, we see it cannot be the case that each pair must have the strictly greater than relation, because there are only finitely many non-negative integers less than n. Eventually, by Lemma 2, there must be a pair . This can only be true when , since and for all   .


So for conciseness, we will say in this article that means repeated evaluations of the sum of digits function until .

Theorem 1

Theorem 1: For all :  mod 9 and  mod 9.

Proof: Let be given, where m has non-negative digits as defined above, and n has non-negative digits .

Then

(1)

and

(2)

hence, for addition,

(3)

Then by Lemmas 2 and 3,

which proves the first part of the theorem.


Similarly, for multiplication,

By Lemma 3, we can freely interchange x and s(x) and maintain equivalence mod 9, so

hence,

which proves part 2.