Suppose that a=(rn x rn-1 ... r2 x r1 x r0) 10^3. This notation means that a = 10^(3n) x rn + 10^3(n-1) x rn-1 + 10^3 x r1 + r0. Prove that 13|a if and only if 13|r0-r1+r2-r3+...+(-1)^nrn

To prove that 13 divides a given number a if and only if 13 divides the alternating sum of its digits (r0 - r1 + r2 - r3 + ... + (-1)^n * rn), we can follow these steps:

Step 1: Write the number a in terms of its digits using the given notation.

a = (rn x 10^(3n)) + (rn-1 x 10^(3(n-1))) + ... + (r2 x 1000) + (r1 x 100) + r0

Step 2: Express a in terms of the alternating sum of its digits r0 - r1 + r2 - r3 + ... + (-1)^n * rn.

Using the fact that 10^(3n) is congruent to 1 (mod 13), 10^(3(n-1)) is congruent to 10 (mod 13), 1000 is congruent to 10 (mod 13), and 100 is congruent to 9 (mod 13), we can rewrite a as follows:

a ≡ (r0 x 1) + (r1 x (-1)) + (r2 x 1) + (r3 x (-1)) + ... + (rn x (-1)^n (mod 13)

Step 3: Simplify the expression for a modulo 13.

Combining like terms, we get:

a ≡ (r0 - r1 + r2 - r3 + ... + (-1)^n * rn) (mod 13)

Step 4: Establish the equivalence between the divisibility of a by 13 and the divisibility of the alternating sum of its digits by 13.

We can conclude that 13 divides a if and only if 13 divides the alternating sum of its digits (r0 - r1 + r2 - r3 + ... + (-1)^n * rn) based on the equivalence established in Step 3.

Therefore, we have proven that 13 divides a if and only if 13 divides the alternating sum of its digits (r0 - r1 + r2 - r3 + ... + (-1)^n * rn).