Subtraction of a number I have a number $x$. If I remove the last digit, I get $y$. Given $x-y$, how can I find $x$?
For example x=34 then y=3 given 34-3=31, I have to find 34.
if x=4298 then y=429 , given 4298-429 = 3869 . how can I find 4298 from given 3869?
 A: Removing the last digit is a division by $10$ (and the last digit is lost).
So $x-y=x-\dfrac x{10}\approx\dfrac{9x}{10}$, and reciprocally $x\approx\dfrac{10(x-y)}9$.
$$31\to34.44\cdots$$
$$3869\to4298.88\cdots$$
For safety, check the solution after truncating.
A: Suppose :
$$x=\sum_{k=0}^na_k10^k $$
then :
$$y=\sum_{k=0}^{n-1}a_{k+1}10^k $$
so :
$$x-y=a_0+\sum_{k=1}^na_k(10^k-10^{k-1}) $$
$$x-y=a_0+\sum_{k=1}^n9a_k10^{k-1}=a_0+\frac{9}{10}\sum_{k=1}^n9a_k10^{k} $$
$$x-y=a_0+\frac{9}{10}(x-a_0)=\frac{9x+a_0}{10}$$
Edit : The first part doesn't give the answer to the question (but the answer follows easily from it), for completude I give the rest of the answer now.
This should give the solution, now we call $f$ the function associating this number to $x$. Suppose now that $x>z$ (with first digit respectively $a_0$ and $c_0$) gives the same number through this function $f$ then you have :
$$9x+a_0=9z+b_0$$
So that :
$$9(x-z)=b_0-a_0=:n$$
The number $n$ must verify $-10<n<10$ from the second term and from the first it sould be a positive multiple of $9$, so the only possibility is $b_0=9$ and $a_0=0$ so that :
$$x\text{ is divisible by } 10 \text{ and } z=x-1 $$
On the other hand if $x=10n$ with $n>0$ then set $z=x-1$ then :
$$f(x)=\frac{9x+0}{10}=9n$$
$$f(z)=\frac{9(x-1)+9}{10}=9n $$
So we see that the set of values of $k$ for wich the equation $f(x)=k$ has 2 solutions is exactly  $9\mathbb{N}^*$. In that case one can always recover both values : $10n$ and $10n-1$ (where $n=\frac{k}{9}$).
Suppose finally that :
$$n=9k+r\text{ with }1\leq r\leq 8$$
Then from :
$$f(x)=n$$
we get :
$$90k+10r=9x+a_0 $$
Thus, evaluating modulo $9$ we see that $r=a_0$ and finally :
$$90k=9(x-r)\Rightarrow 10k=x-r\Rightarrow x=10k+r $$
And here there are no ambiguity. To make it complete :
$$f(x)=\frac{90k+9r+r}{10}=9k+r=n $$
So we have proven that $f$ is surjective and essentially give a bijection between classes mod $10$ and classes mod $9$ but sticking classes $0$ and $9$ mod $10$ to the same classe $0$ mod $9$. Just to be precise I am seeing $f:\mathbb{N}^*\rightarrow \mathbb{N}^*$.
A: Clément Guérin's answer is correct as far as it goes. But the fact is, you can't always recover $x$ unambiguously from $x-y$. This is obvious if you think about it: $x-y$ is always less than $\frac{9}{10}x + 1$; so $x \mapsto x-y$ can't be injective.
For instance, $10$ and $9$ both map to $9$; and $54970$ and $54969$ both map to $49473$.
In general, if $x-y$ is divisible by $9$, then there are two solutions for $x$; otherwise Clément Guérin's answer gives a unique solution.
A: Let $d=x-y$ be the known difference.  Since $x=10y+b$ with $0\le b\le9$, then  $d=9y+b\equiv b$ mod $9$.  Thus $b$ can be retrieved uniquely from $d$ by casting out $9$s, unless the result of doing so is $0$, in which case $b$ is either $0$ or $9$.  When the result is unique, as it is for $d=3869\equiv8$ mod $9$, you can retrieve $y=(d-b)/9$, and then get $x=10y+b$.
The simple example $100-10=90=90-0$ illustrates what happens when $d\equiv0$ mod $9$.
