# Digit Concatenation (A Little Puzzle Turned Interesting)

January 2, 2011 1 Comment

I was given the following little problem:

*Find a number such that prepending the digit ‘1’ to the front of it gives a number one-third as big as appending the digit ‘1’ to the end.*

To make things clearer, let us denote digit concatenation by a colon. So for instance, . Then the problem is to find a natural number *x* such that .

Let us generalise the problem to make it more interesting. First of all, instead of the digits being in base 10, let them be in base *b*. Next, let us change the factor of 3 to a factor of *k*, so we have .

Obviously and , where *x* is a *d* digit number (in base *b*). Thus we are attemping to solve:

Now let us first remark that this implies that *k* and *b *are coprime, and so we shall assume that in what follows. Rearranging the equation, we get:

Since this must be an integer, there can only possibly be solutions when . However, as it follows that this is equivelent to:

As *b* and *k* are coprime, so are *b* and *b-k*. Therefore *b* is a primitive root. Thus it is equal to one exactly when it is raised to the power of multiples of . In particular, valid values of *d* must be of the form .

So that is when there *can* be solutions. (And furthermore, there can only be one solution for each length *d*)

Suppose that S and R are numbers with this property. That is, and , where the digit concatenations are in base *b. *Let us also define S to be *s* digits long (in base *b*) and R to be *r* digit long (in base *b*).

From the above result, and (where in fact ).

Now consider the number :

Then T has the property too, and T is of length . Notice how, as expected, this is still of the required form.

In particular, in the case S = R, it follows that if there is a solution of length *s* there is a solution of length *k(**s+1)-1*, for each *k*.

Now we can turn our attention but on to the specific problem again. Here *b = 10* and *k = 3*. Therefore all possible solutions must be of length *d = 6k+5* for various values of *k*. For *d = 5* we have that:

We must verify that this actually *does* work. And indeed, you can see that 142857×3 = 428,571, as required. It follows that *all* solutions are this repeated a number of times with 1 in the middle.

However, there is something else to be noticed here. The above could be written as:

And so you can see the relationship between our solution and the fraction 1/7. In fact,

1/7 = 0.1**42857**14285714285714…

2/7 = 0.28571**42857**1428571429…

3/7 = 0.**42857**142857142857143…

4/7 = 0.571**42857**142857142857…

5/7 = 0.71**42857**1428571428571…

6/7 = 0.8571**42857**14285714286…

(In bold is the first occurrence of the found solution. Of course, it repeats after that with a ‘1’ between them.)

So the weird fact that the decimal expansions of sevenths have the same general pattern (except with some stuff at the start) is due to this little problem. I may expand on this more at a later point, but for now it is at least clear there is a connection.

Jack…. sometimes i’m a little scared and a lot intimidated by how clever you are. More to the point… that I’m friends with someone as clever as you!

You must easily be the smartest person I’ve met.

🙂