I saw this on rec.puzzles many years ago, but can't find the reference to credit the source.

I am thinking of a large number. If you want to multiply it by a two digit number $ab$ with $a \lt b$, search through the number for the digits $ba$ in order. Write the part starting at $a$, two zeros, and the part ending with $b$, and you have the product. If you represent the original number as $AbaB$ the product is $aB00Ab$. If you want to multiply by $ab$ with $a \gt b$, let $c=a-1$ and look for $ac$. If the number is $AacB$ the product is $cB00Aa$. If you want to multiply it by a multiple of $11$, so $aa$, there are two copies of $aa$ in the number. Do the same as in the previous sentence, but use the one that does not have a $9$ after it in the original number.

What number am I thinking of?

  • 1
    $\begingroup$ Wow, nice puzzle! Can we assume that the digits $ab$ for $a \neq b$ appear only once? $\endgroup$
    – athin
    Commented Aug 14, 2019 at 7:24
  • 1
    $\begingroup$ Do digits $b$ and $a$ have to be side by side in the big number? Does the "part starting at $a$" includes $a$? The same for $b$. Are there any restrictions as to what $a$ and $b$ can be? $\endgroup$
    – Ardweaden
    Commented Aug 14, 2019 at 7:59
  • 1
    $\begingroup$ Or am I getting this wrong and $ab$ is one specific number? $\endgroup$
    – Ardweaden
    Commented Aug 14, 2019 at 8:14
  • $\begingroup$ Is the essential equation $AbaB \times ab = aB00Ab$ where $A$ and $B$ are some strings of digits of unknown length? $\endgroup$
    – hexomino
    Commented Aug 14, 2019 at 11:25
  • $\begingroup$ @hexomino That's my interpretation. $\endgroup$ Commented Aug 14, 2019 at 11:33

2 Answers 2


And here is the number you are probably thinking of:

$(10^{108}-1)/109$ = 9174311926605504587155963302752293577981651376146788990825688073394495412844036697247706422018348623853211

It works only for $ab$ where $a \le b$. I suppose that it is a mistake in the problem statement. Others have proven that as it is, the problem is unsolvable.

And here is how I came to that number.

This behaviour of the multiples being a rotation of the original number occurs when the number is the recurrent part of the decimal expansion of some 1/N.

For example for N=7, 1/N = 0.142857142857... . The recurrent part is 142857. The multiples of 142857 are 142857, 285714, 428571, 571428, 714285, 857142 and 999999.

The additional 00 indicate that 1/N actually starts with two zeroes: 0.009174... The zeroes are stripped in the original number, but must be restored in every rotation of the number. The fact that the recurrent part starts with 00 tells me that N is betwen 100 and 999.

The recurrent part of $1/N$ for a large N is of the form $(10^R-1)/N$ where R is the period of the decimal expansion, or the length of the recurrent part. So I checked only numbers of that form.

The number of digits should have been 100 to accomodate with all the combinations of $ab$ once from 10 to 99, plus a second copy of $aa$'s from 11 to 99, plus 1 because the first and last digits can match only once. The actual length is 106. Since cases with $a<b$ are not counted, it actually could be anywhere from 46 and larger. Anyway I tried all lengths up to 120.

So, using a computer, I searched for numbers of the form $(10^R-1)/N$ that contain all combination of 2 digits $ab$. I didn't find any so I ignored the case $b=0$. I found a few candidates. But checking for which $ab$ the multiplication procedure actually works, I noticed that it works only when $a \le b$. Since other have proven that the problem is not possible as stated, I assume it is a mistake, maybe the procedure for $a>b$ is different than for $a<b$.

PS: I have been playing with this problem. You can extend it to $ab$ with $a > b$ with the following rule:

  • if a = b+1 then search $bb9$ and split between the b's.
  • if a > b+1 then search $b(a-1)$ and split between b and (a-1).

For example, to multiply by 42 don't search for 24 but 23 and split the number between 2 and 3. For the search with 0's you might need to imagine the '00' in front.

  • $\begingroup$ \geq will produce $\geq$. Also, how did you come up with this number, and with "the" (?) way to fix the statement? $\endgroup$ Commented Aug 14, 2019 at 12:20
  • $\begingroup$ This does seem to be a very interesting number! It does seem that multiplying it by $ab$ with $a \geq b$ gives you some cyclic permutation of the digits with two 0s included but I don't see how it matches the question description. Could you expand a bit more, please? $\endgroup$
    – hexomino
    Commented Aug 14, 2019 at 12:29
  • $\begingroup$ @ArnaudMortier I've googled around a bit and it looks like this is the periodic part of $\frac{1}{109}$ and is the 10th cyclic number (in decimal). This means that cyclic permutations of the number (including two 0s at the beginning) are multiples of it. $\endgroup$
    – hexomino
    Commented Aug 14, 2019 at 12:37
  • $\begingroup$ @hexomino I was doing the same :) it would still be interesting to see a natural way to come up with this number. $\endgroup$ Commented Aug 14, 2019 at 12:41
  • $\begingroup$ Multiplying by ab with a<b also gives a rotation of the number, it is only the method to find where to split the number that fails. $\endgroup$
    – Florian F
    Commented Aug 14, 2019 at 13:20

I am going to prove that

such a number cannot exist, because for any $a$ there has to be more than one instance of $aa$ not followed by a $9$. The proof relies on the condition that for every digit $a$, there are exactly two instances of $aa$ in the number. Note that the number found by @FlorianF fails to meet this criterion (there is only one $99$).


There is $999$ somewhere in $X$, and no other $99$'s. Indeed, we know that there are only two $99$ sequences, and one of them is followed by a $9$.

Now let us multiply $X$ by $99$. Since there is $\color{red}{99}9$ in $X$, $99\times X$ ends with $\color{red}{99}$ and therefore $X$ ends with $01$. This is because the last two digits of $99\times x$ are always equal to $100$ minus the last two digits of $x$.

Now because of this, the product of $X$ by $aa$ for arbitrary $a$ ends with $aa$, and this gives us that for every digit $a$, the sequence $aa$ not followed by a $9$ has to be preceded by yet another $a$, which makes it $aaa(\text{some digit}\neq 9)$, which proves the claim.

Let me dump here previous thoughts that turned out not to be useful but might be in the future.


$X$ ends with $1$.
Indeed, by Rule #1 the product $X\times(ab)$ always ends with the digit $b$.


$X$ begins with $9$ (followed either by a non-zero digit, or by $09$ and then a non-zero digit).
This is because $11\times X$ has two more digits than $X$. The smallest such number (with any fixed number of digits) is $909090...$ but there can't be more than one instance of $09$ in $X$, hence the precision in parentheses.

  • $\begingroup$ I arrived at the same conclusion as you by a different route. It seems something is probably wrong with the statement of the problem... $\endgroup$
    – Gareth McCaughan
    Commented Aug 14, 2019 at 12:03
  • $\begingroup$ @GarethMcCaughan Indeed, if this is not the intended answer, since the OP does not have the original reference it will be hard to feel around for the correct statement. $\endgroup$ Commented Aug 14, 2019 at 12:06
  • $\begingroup$ @ArnaudMortier Apologies my interpretation was that there be just one instance of $ab$ but I'll admit the wording seems to support your interpretation. Does this mean that, a priori, $X$ must contain every possible substring of two digits? $\endgroup$
    – hexomino
    Commented Aug 14, 2019 at 12:13
  • $\begingroup$ @hexomino Yes, that's how I interpret it. $\endgroup$ Commented Aug 14, 2019 at 12:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.