Telephone Number Checksum Problem I am having difficulty solving this problem. Could someone please help me? Thanks
"The telephone numbers in town run from 00000 to 99999; a common error in dialling on a 
standard keypad is to punch in a digit horizontally adjacent to the intended one. So on a 
standard dialling keypad, 4 could erroneously be entered as 5 (but not as 1, 2, 7, or 8). No 
other kinds of errors are made.
It has been decided that a sixth digit will be added to each phone number $abcde$. There 
are three different proposals for the choice of $X$:
Code 1: $a + b + c + d +e  + X$ $\equiv 0\pmod{2}$ 
Code 2: $6a + 5b + 4c + 3d + 2e + X$ $\equiv 0\pmod{6}$
Code 3: $6a + 5b + 4c + 3d + 2e + X$ $\equiv 0\pmod{10}$
Out of the three codes given, choose one that can detect a horizontal error and one that cannot detect a horizontal error.
"

Code 1 can detect horizontal error.  Let $c$ be the correct misdialed digit (order doesn't matter because they're added) and let $c'$ be the mistaken misdialed digit.  For any two horizontally adjacent digits consist of an odd and even number.  That is, $c-c'\equiv 1 \pmod 2$.  It follows that the sum of the new digits will be
$$
a+b+c'+d+e+X\equiv\\
a+b+c+d+e+X+(c'-c)\equiv\\
0+(c'-c)\equiv\\
1 \pmod 2
$$
Thus, any wrong number will fail the test.
Code 2 cannot detect horizontal error.  Consider, for example, the phone number $123231$.  The number $223231$ will pass the test even though a horizontal error was made with the first digit.  In general, this code fails to detect errors in the first digit.
