# Thread: Modulo and the Sum of Digits

1. ## Modulo and the Sum of Digits

Hey all, I would really appreciate some help with the following:

Let n = the sum from i=0 to v(n)-1 of x-sub-i * 10^i, where each x-sub-i is a digit.

n "is the same as" x-sub-0 (mod 2)

Well I get this one by doing the following:

n = x-sub-(v(n)-1)*10^(v(n)-1) + x-sub-(v(n)-2)*10^(v(n)-2) + ... + x-sub-0 * 10^0

but 10 is the same as 0 (mod 2) so 10^j is the same as 0^j

so n is the same as x-sub-0 (mod 2)

But how can I prove that:
n is the same as x-sub-0 + 10*(x-sub-1) (mod 4)
n is the same as x-sub-0 + 10*(x-sub-1) + 100*(x-sub-2) (mod 8)
n is the same as x-sub-0 (mod 5)

2. Originally Posted by jstarks44444
Let n = the sum from i=0 to v(n)-1 of x-sub-i * 10^i, where each x-sub-i is a digit.
This line is bugging me. You have defined n in terms n:
$\displaystyle \displaystyle n = \sum_{i = 0}^{v(n) - 1} x_i \cdot 10^i$

Is the sum n or is n the argument of the function v(n)? I doubt you can have it both ways.

-Dan

3. Originally Posted by jstarks44444
Hey all, I would really appreciate some help with the following:

Let n = the sum from i=0 to v(n)-1 of x-sub-i * 10^i, where each x-sub-i is a digit.

n "is the same as" x-sub-0 (mod 2)

Well I get this one by doing the following:

n = x-sub-(v(n)-1)*10^(v(n)-1) + x-sub-(v(n)-2)*10^(v(n)-2) + ... + x-sub-0 * 10^0

but 10 is the same as 0 (mod 2) so 10^j is the same as 0^j

so n is the same as x-sub-0 (mod 2)

But how can I prove that:
n is the same as x-sub-0 + 10*(x-sub-1) (mod 4)
n is the same as x-sub-0 + 10*(x-sub-1) + 100*(x-sub-2) (mod 8)
n is the same as x-sub-0 (mod 5)

You better make a visit in the LaTeX Help subsection of the section "Math Resources" to learn quickly

how to properly write mathematics in this forum. What you wrote is very hard to understand.

Tonio

4. the way you typed it is correct. i believe you can have it both ways

v(n) is the number of digits of n with respect to base 10

5. Originally Posted by jstarks44444
n is the same as x-sub-0 + 10*(x-sub-1) (mod 4)
n is the same as x-sub-0 + 10*(x-sub-1) + 100*(x-sub-2) (mod 8)
n is the same as x-sub-0 (mod 5)
Consider, in each case, the truncated series $\displaystyle 1000x_3 + 100x_2 + 10x_1 + x_0$

For example, mod 4: $\displaystyle 1000 \equiv 0$, $\displaystyle 100 \equiv 0$, $\displaystyle 10 \not \equiv 0$. So for mod 4 we have that $\displaystyle n \equiv 10x_1 + x_0$. (Actually $\displaystyle n \equiv 2x_1 + x_0$ in mod 4. Can you prove this?)

Apply the same arguments for mod 8 and mod 5. Note that your mod 8 formula also can be simplified: $\displaystyle n \equiv 4x_2 + 2x_1 + x_0$.

-Dan