Prove that there will be atleast one even number in the sum of odd numbered digit and its reverse,if the number is of the form 4n+1.

75 Views Asked by At

Prove that there will be at least one even number in the sum of odd numbered digit and its reverse,if the number of digits is of the form $4n+1$.

If the number of digits is of the form $4n+3$ ,there exist number whose sum of the number and its reverse contains all odd numbers.

1

There are 1 best solutions below

1
On

$$\sum_{i=0}^{n-1}{10^i(d_i+d_{n-i-1})} = \sum_{i=0}^{m-1}{10^i(2x_i+1)}$$ $$d_i \in\left\{0, 1, 2, 3, 4, 5, 6, 7, 8, 9\right\}$$ $$x_i \in\left\{0, 1, 2, 3, 4\right\}$$ $$m \in\left\{n, n+1\right\}$$

Let $m=n+b, b\in\left\{0, 1\right\}$

$$\sum_{i=0}^{n-1}{10^i(d_i+d_{n-i-1})} = \sum_{i=0}^{n+b-1}{10^i(2x_i+1)}$$

$$\sum_{i=0}^{n-1}{10^i(d_i+d_{n-i-1}-2x_i-1)} = \begin{cases}0 & b=0\\10^n(2x_n+1) & b = 1\end{cases}$$

$$\sum_{i=0}^{n-1}{10^i(d_i+d_{n-i-1}-2x_i-1)} = 10^n(2x_n+1)b$$

Because the carry of the sum of two numbers is always 1 or 0,

$$\sum_{i=0}^{n-1}{10^i(d_i+d_{n-i-1}-2x_i-1)} = 10^nb$$

Let $y_i=d_i+d_{n-i-1}-2x_i-1$

$$\sum_{i=0}^{n-1}{10^iy_i} = 10^nb$$

By the fact that $2x_i+1$ is the sum of $d_i+d_{n-i-1} \bmod 10$

$$2x_i+1 = d_i+d_{n-i-1}+p_i \bmod 10 = d_i+d_{n-i-1}+p_i-10q_i$$

$$p_i, q_i\in\left\{0, 1\right\}$$

$$y_i = 10q_i-p_i \in\left\{-1, 0, 9, 10\right\}$$

$n$ is odd, so let $n=2k+1$

$$y_i = d_i+d_{2k-i}-2x_i-1$$

For $i=k$

$$y_k = 2(d_k-x_k)-1 \in \left\{-1, 9\right\}$$

For $i=k+t, -k \leq t \leq k$

$$y_{k+t} = d_{k+t}+d_{k-t}-2x_{k+t}-1$$

$$y_{k+t}-y_{k-t} = 2(x_{k+t}-x_{k-t})$$

Consider the range of $x_i$

$$-8 \leq y_{k+t}-y_{k-t} \leq 8$$

Consider all possible values of $y_i$

$$y_{k+t} = y_{k-t}$$

All $10^i$ terms must be canceled out, except for $i=n$, so we have following rules.

  1. If $y_i\in\left\{-1,9\right\}$, then $y_{i-1}\in\left\{9, 10\right\}$ and $\exists j<i$ such that $y_j=10$
  2. If $y_{i}\in\left\{9, 10\right\}$, then $y_{i+1}\in\left\{-1, 9\right\}$ or $i=n-1$

Now replace $i$ by $k+t$ and $k-t$, and assume $t\geq 0$.

  1. If $y_{k+t}=y_{k-t}\in\left\{-1,9\right\}$, then $$y_{k+t-1}=y_{k-t+1}\in\left\{9, 10\right\}$$ $$y_{k-t-1}=y_{k+t+1}\in\left\{9, 10\right\}$$ and $\exists j<k-t$ such that $y_j=10$
  2. If $y_{k+t}=y_{k-t}\in\left\{9, 10\right\}$, then $$y_{k-t-1}\in\left\{-1, 9\right\}$$ $$y_{k-t+1}=y_{k+t-1}\in\left\{-1, 9\right\}$$ $y_{k+t+1}\in\left\{-1, 9\right\}$ or $t=k$

If $y_{k+t}=9$ for some $t$, because $y_{2k}=y_0\in\left\{0, 10\right\}$ would never be 9, it is sure that $t\neq k$, then $$y_{k+t-1}=y_{k-t+1}=y_{k+t+1}=y_{k-t-1}=9$$

This will make $y_{i}=9$ for all $i$, which violates $\exists j<k-t$ such that $y_j=10$.

So no $y_i$ could be 9. We can simply the rules.

  1. $y_i\in\left\{-1, 0, 10\right\}$
  2. If $y_{k+t}=y_{k-t}=-1$, then $$y_{k+t-1}=y_{k-t+1}=10$$ $$y_{k-t-1}=y_{k+t+1}=10$$
  3. If $y_{k+t}=y_{k-t}=10$, then $$y_{k-t-1}=-1$$ $$y_{k-t+1}=y_{k+t-1}=-1$$ $y_{k+t+1}=-1$ or $t=k$

We already know that $y_k=-1$, so

If $t$ is odd, then

$$y_{k+t}=10$$

If $t$ is even, then

$$y_{k+t}=-1$$

We know that $y_0 = 10$, because no term will cancel it if $y_0 = -1$, so k is odd.

Let $k = 2v+1$ $$n=2k+1=4v+3$$