142857


Here's a puzzle:

  • Multiply $142857$ by $2$ and you get $285714$ which has the same digits
  • Multiply $142857$ by $3$ and you get $428571$ which has the same digits
  • Multiply $142857$ by $4$ and you get $571428$ which has the same digits
 In fact you keep getting permutations of $142857$  till you get to a multiple of $7$ at which point you get $999999$.

 Why?

I can't remember now how I figured it out, but I do remember not being able to sleep, then having some sort of eureka moment and running downstairs in the middle of the night to scribble down the answer.

The solution involves some group theory, which I studied last century when I did my Maths degree at Bristol.  Periodically I have a little panic that I've forgotten everything I learned there, and I refresh my memory.  I think it must have been after one of these episodes that my subconscious linked it to this strange number that I probably first came across at school.  Anyway, the solution....

Consider the set

$$
G = {x \in \mathbb{N}^{+}: x \lt 1000000}
$$

i.e. integers strictly between 1 and 999999 inclusive.  Then define a group operator by

$$
ab = (a + b) mod 10^6 + \Big\lfloor\frac{a + b}{10^6}\Big\rfloor
$$

i.e. addition modulo 1 million but with an extra 1 added in if there is a carry.  It's easy to see that this is closed in G.  It is also easy to see it meets the 3 axioms that define a group

  • $\forall a,b,c: (a b) c = a (b c)$
  • $\exists I: \forall a, I a = a$ (in this case it's $999999$)
  • $\forall a \exists a^{-1} : aa^{-1} = I$ (it's just $999999 - a$)
 Now the number of elements of $G$ is $999999$ and $7$ divides $999999$.  It turns out that if a prime $p$ divides the order of a group then there must be a subgroup $\{a^0,a^1,...,a^{p-1}\}$.

(I think the way you prove this is by induction on the order of $G$. I.e. pick a random element $x \in G$, let $H$ be the subgroup containing powers of $x$, if $x$ is not of order $p$ (or a multiple of $p$) then $G/H$ must have a $y$ in it of order $p$.)

Now since $142857$ times $7$ is $999999$ (the identity) then $142857$ must be of order 7 and so must be in the subgroup. w.l.o.g. we can set

$$
a = 142857

$$

So, are we any closer to answering the question: why are multiples of $142857$ all permutations?  Yes, we are!  If $x \in \{a^0,a^1,...,a^{p-1}\}$ then what does $x^{10}$ look like?  Well, going back to the definition of the group operator we can see that it involves multiplying the number by ten and adding the carry. I.e. taking to the power of 10 means rotating the digits by one.  So

$$
142857^{10} = 428571 \\
428571^{10} = 285714 \\
285714^{10} = 857142 \\
857142^{10} = 571428 \\
571428^{10} = 714285 \\
714285^{10} = 142857
$$

Each one of these 6 numbers  must be in $\{a^0,a^1,...,a^{p-1}\}$, but this is just

$$
\{999999, 142857, 142857 \times 2, ..., 14285 \times 6\}
$$

So all multiples of 142857 up to and including 6 must be in fact rotations of the digits.


Comments

Popular posts from this blog

How To Make ASCII Diagrams Beautifuller

Why growth is falling in all developed countries (as a long term trend)

Three ways to look at the Bell/GHZ experiment