Digit Concatenation (A Little Puzzle Turned Interesting)

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, 12:34 = 1234. Then the problem is to find a natural number x such that 3(1:x) = x:1.

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 k(1:x) = x:1.

Obviously x:1 = bx + 1 and 1:x = b^d + x, where x is a d digit number (in base b). Thus we are attemping to solve:

k(b^d+x) = bx + 1

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:

x = \frac{kb^d - 1}{b-k}

Since this must be an integer, there can only possibly be solutions when kb^d - 1 = 0 \pmod{b-k}. However, as k = b \pmod{b-k} it follows that this is equivelent to:

b^{d+1} = 1 \pmod{b-k}

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 \phi(b-k). In particular, valid values of d must be of the form d = \phi(b-k)r - 1.

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, k(1:S) = S:1 and k(1:R) = R:1, 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, s = a_1q - 1 and r = a_2q - 1 (where in fact q = \phi(b-k)).

Now consider the number T = S:1:R:

T:1 = (S:1) + (R:1) b^{s+1} = k(1:S) + kb^{s+1} (1:R) = k[(1:s) + (1:R)b^{s+1}] = k(1:S:1:R) = k(1:T)

Then T has the property too, and T is of length r+s+1.  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:

x = \frac{kb^d - 1}{b-k} = \frac{3 \times 10^5 - 1}{10-3} = 42,857

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:

x = 10^5 \times \frac{3}{7} - \frac{1}{7}

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

1/7 =  0.14285714285714285714…
2/7 =  0.28571428571428571429…
3/7 =  0.42857142857142857143…
4/7 =  0.57142857142857142857…
5/7 =  0.71428571428571428571…
6/7 =  0.85714285714285714286…

(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.

Advertisements

One Response to Digit Concatenation (A Little Puzzle Turned Interesting)

  1. Jess says:

    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.

    🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: