# For which number does multiplying it by 99 add a 1 to each end of its decimal representation?

This was asked by my maths lecturer a couple of years ago and ive been wracking my brains ever since:

Find a number that, when multiplied by 99 will give the original number but with a 1 at the beginning and a 1 at the end.

For example: 42546254 * 99 would equal 1425462541
(it doesn't, but it illustrates what the answer would look like)

-

$$112359550561797752809 \cdot 99 = 11123595505617977528091\;.$$

If you put what you say into an equation, it reads

$$10^n+1+10x=99x\;,$$ $$10^n+1=89x\;.$$

Then you just need to find an $n$ such that $10^n\equiv 88\pmod{89}$, and $n=22$ works.

-
It is perhaps worth mentioning that when looking for n fullfilling $10^n \equiv -1 \pmod{89}$ you also know that $10^{2n} \equiv 1 \pmod{89}$. By Fermat's little theorem you know that $10^{88} \equiv 1 \pmod {89}$, hence $2n\mid 88$, i.e. $n\mid 44$ holds for the smallest possible n. So you only need to try the divisors of 44. – Martin Sleziak Apr 5 '11 at 11:12
It may prove instructive to revisit your solution using the hint in my answer. – Bill Dubuque Apr 5 '11 at 19:39
Can you explain how you created your original equation of 10^n+1+10x=99x? – Xonatron Jan 26 '12 at 20:38
@Matthew: "Find a number that, when multiplied by 99 will give the original number but with a $1$ at the beginning and a $1$ at the end." The right-hand side, $99x$, corresponds to the first part of that sentence. The left-hand side, $10^n+1+10x$, corresponds to the second part of the sentence: Appending a digit $1$ at the end of a number multiplies it by $10$ and adds $1$, and appending a digit $1$ at the beginning adds $10^n$, where $n$ is the number of digits. – joriki Sep 30 '12 at 12:21

A down-to-earth way of finding the answer is to write the equation as $100x - x = 1x1$, or $1x1 + x = 100 x$. So if $x=abc\dots xyz$, then

1abc...xyz1
+  abc...xyz
------------
=abc...xyz00

This means that the last digit $z$ must be 9, so we now have

1
1abc...xy91
+  abc...xy9
------------
=abc...xy900

And from this we see that y=0, so that

11
1abc...x091
+  abc...x09
------------
=abc...x0900

Hence x=8, and so on. After 21 steps you reach

11123595505617977528091
+  112359550561797752809
------------------------
=11235955056179775280900

and then you're done.

-
could you explain this in a little more detail? im having trouble following what you're doing... – Tom Apr 5 '11 at 13:33
I appreciate the down-to-earth method! This could have been a "challenge problem" for a gifted elementary school student, but who wants to hear a kid invoke F.L.T.?!?! :) – The Chaz 2.0 Apr 5 '11 at 13:34
@Tom: OK, I'll try. I hope the setup is clear: you want to find digits, a, b, ..., x so that the addition works out as indicated. Starting from the right, we see from the last column that 1+z must give something ending in zero, and the only way this can happen is as 1+9=10. So z=9, and we carry 1 to the next column. And we also replace all three z's with 9. This gives us the situation in the second diagram. Now the sum of the second column from the right is 1 (from the carry) + 9 (from the z) + y (still unknown) = something ending in 0. Already 1+9=10, so y=0. (Cont.) – Hans Lundmark Apr 5 '11 at 14:21
Replace all y's by zeros, and carry the one to the next column. Then you're in the situation shown in the third diagram. Here 1 (from the carry) + 0 (from the y) + x (still unknown) = something ending in 9 (from the z two steps earlier!). This must be 1+0+8=9, so x=8, and this time we don't have to carry anything to the next column. And so on... – Hans Lundmark Apr 5 '11 at 14:23
It may prove instructive to revisit your solution using the hint in my answer. – Bill Dubuque Apr 5 '11 at 19:39

It was shown that $\rm\ x = 112359550561797752809\:.$
Notice that $1/89\ =\ 0.0112359550561797752808988\ldots$

EXERCISE $\:$ Explain it (this, perhaps, is the point of the OP).

NOTE $\$ This is closely connected with fibonacci numbers. Hint:

$\rm\quad\quad\quad x^n\ =\ f_n\ x + f_{n-1}\ (mod\ x^2-x-1)\$

and note $\rm\ f_{11} = 89\$ which is $\rm\ x^2-x-1\$ for $\rm\ x = 10\:.$

-
1/89 is one of my favourite decimal expansions: it's the fibonacci sequence! 00112358(13)---oops, 13 is too big so carry one, change the 8 to a 9, etc etc. If you think about it this way then it's a miracle that it recurs :-) – Kevin Buzzard Apr 5 '11 at 20:31
@Kevin: Yes, I was going to mention that. In fact here is a further hint for readers: $\rm\ x^n\ =\ f_n\ x + f_{n-1}\ (mod\ x^2-x-1)\$ and $\rm\ f_{11} = 89 = x^2-x-1,\ x = 10\:.$ – Bill Dubuque Apr 5 '11 at 20:37
@Kevin: Thanks for these interesting pointers. I noticed the Fibonacci-like pattern in the residues of $10^n$ mod $89$ when I was looking for the solution, and I put it on a mental shelf as "something to be looked into some time" :-) – joriki Apr 5 '11 at 21:11