# Divide an integer by 2 by replacing 9 with 0

What are examples of integers that halve their values when all 9's in their decimal representations are replaced with 0's?

• is this in base 10? – dcfyj Jul 27 '16 at 19:19
• Replace 0->9 or 9->0 ?? – ABcDexter Jul 27 '16 at 19:37
• @ABcDexter Replace nines with zeroes. So (e.g.) $2989$ becomes $2080$. – DooplissForce Jul 27 '16 at 19:47
• @DooplissForce please read the question title again. – ABcDexter Jul 27 '16 at 19:49
• Already resolved by ffao and McFry, and to prove there is no other classic solution then 0, it is almost trivial if you reverse the question into: which integers are multiplied by 2 if some of 0's are replaced by 9. – z100 Jul 27 '16 at 20:08

Not the usual decimal representation, but...

$1.9999999....$ is double $1.00000...$

I originally did not point this out as to not complicate the answer, but we can make as many examples as we want:

Just move the decimal point in the previous answer to the right:
$19.999999....$ is double $10.0000...$
$199.99999....$ is double $100.000...$
and so on.

• Moving the decimal point around creates other numbers that also satisfy the property. – Anon Jul 27 '16 at 19:27
• Congratulations, every integer has two decimal representations. @McFry I think your comment deserves to become an answer (0, 2, 20, 200 ...and their negatives). – z100 Jul 27 '16 at 19:47
• @Lordofdark But that representation is not a decimal representation, as the question asks for. – ffao Jul 27 '16 at 22:21
• But the solution here is not integer at all... en.wikipedia.org/wiki/Integer – Crowley Jul 28 '16 at 12:13
• It is, that number is just more commonly written as 2. I'd rather not explain math in comments of a puzzling site, but see math.stackexchange.com/questions/11/… – ffao Jul 28 '16 at 12:15

This is kinda cheap, but:

$0$ works, since replacing all of the nines in $0$ (all zero of them) results in $0$, and $\frac{0}{2} = 0$.

• Is this trivial solution the only one that exists? – z100 Jul 27 '16 at 19:44
• Yes. See proof below. – A. Mirabeau Jul 27 '16 at 20:40
• @A. Mirabeau See my comment under original question. – z100 Jul 27 '16 at 21:09

One solution is:

0... and this is also the only whole-number solution!

Explanation:

* If you take a number containing at least one 9 and subtract the same number with all 9s replaced by 0s, then the difference between them will consist of some sequence of 0s and 9s.
* Specifically, the difference contains a 9 in every place value in which a 9 in the minuend (the original number, before the minus sign) is replaced by a 0 in the subtrahend (the replaced number, after the minus sign). All other digits of the difference are 0s.
* So the difference has a 9 in each place value where the minuend has a 9 and the subtrahend has a 0, and the difference has 0s in all other place values.
* If the substitution process halves the minuend (the original number), then the difference must be equal to the subtrahend (the subtracted and replaced number, after the minus sign).
* If the subtrahend and the difference are equal, then all their digits -- in all place values -- must be identical.
* But recall that wherever the difference has a 9, the subtrahend has a 0.
* So the difference can contain only 9s and 0s, and if the minuend is halved, it can't contain any 9s. Therefore, it must contain only 0s, making it equal to 0.
* Therefore, the subtrahend is also 0.
* And solving x - 0 = 0 for x, the minuend is also 0.

• +1 - But why would equal numbers necessarily contain identical digits in all places? – GOTO 0 Jul 27 '16 at 20:51
• ffao's answer includes an infinite set of solutions that are also whole numbers. – Paul Jul 28 '16 at 4:58
• You know what I mean. – A. Mirabeau Jul 28 '16 at 5:53
• @Paulpro - Except those answers are not integers, which is what was being asked for. By necessity, those 1(9).999... solutions are all decimals. – ricdesi Jul 28 '16 at 15:02
• @ricdesi Saying that 1.999... isn't an integer is the same as saying that 2 isn't an integer. They're two representations of the same number. That's similar to saying that 4/2 isn't an integer just because it's represented as a rational number. It's still 2. – Paul Jul 28 '16 at 15:12

Here you go:

4 + 5 + 9 It's not the decimal representation, but that could be held against other answers too ...

• But that's not the value, it's the representation and it does specify decimal representation – Areeb Jul 27 '16 at 23:38
• @Areeb The substitution applies to the representation while the value halves. However, arguably the phrasing 'the decimal representation' in the problem statement might be seen to imply that this kind of solution is not permitted. Otoh ... ;-) – collapsar Jul 27 '16 at 23:42
• Why the downvote ? – collapsar Jul 27 '16 at 23:43
• it's probably because you said no constraints on the representation while there are in fact constraints. It would've been a good answer if not for that – Areeb Jul 27 '16 at 23:45
• @Areeb Good point. I should remove that claim. – collapsar Jul 27 '16 at 23:46

I'd say this:

1.9999999999999999999999 ~ 2

Would become this:

1.0000000000000000000000 = 1

Which is half the former value.

• I'm pretty sure this(or something similar) has already been said... – AJL Jul 28 '16 at 21:20
• Yeah, I tried to answer before seeing the answers – ClayKaboom Jul 28 '16 at 21:21