Shuffling the digits of an integer so that the ratio between the resulting numbers is fixed.

Suppose we have a 3-digit integer with all digits distinct. If we create its two shift numbers (resulting by rotation of the original digits), the ratio between the two subsequent numbers (if we order them in ascending or descending order) must be fixed. Find this number.

Suppose the number is xyz and the two resulting numbers, if we shift the digits to the right, are yzx and zxy. Assuming $xyz<yzx<zxy$ (there is no equal, since all digits are distinct), we want $\frac{zxy}{yzx} = \frac{yzx}{xyz} = k$, where k: rational.

Furthermore, it is easy to deduce that 0 is excluded, or one of the resulting numbers would be 2-digit.

I have found 2 such sets of numbers, {243, 324, 432} and {486, 648, 864} and now I am trying to formulate an algebraic solution.

If xyz is the original number, the first rotation is yzx and can be found as follows:

$yzx = xyz*10+x-1000*x$.

Also $zxy= yzx*10+y-1000*y$.

Assuming wlg that $xyz<yzx<zxy$, we must have $\frac{xyz*10+x-1000*x}{xyz} = \frac{yzx*10+y-1000*y}{xyz*10+x-1000*x} = k$

I also noticed that if the 3 numbers are in ascending order $xyz<yzx<zxy$, then their differences $yzx-xyz$ and $zxy-yzx$ have the same 3 digits in rotation.

but I don't think I can advance it any further...


Solution 1:

We want to find triples of integers $(x,y,z)$ such that $$0\lt x\le 9, 0\le y\le 9,0\le z\le 9\tag1$$ $$x\not=y,y\not=z,z\not=x\tag2$$ $$\frac{100z+10x+y}{100y+10z+x}=\frac{100y+10z+x}{100x+10y+z}\tag3$$

From $(3)$, we get

$$ yz-x^2=10(xz-y^2)\implies yz\equiv x^2\pmod{10}\tag4$$ and $$x=-5z+\sqrt{25z^2+10y^2+yz}\implies \sqrt{25z^2+10y^2+yz}\ \in\mathbb Z\tag5$$

Also, if $y\lt z\lt x$, then $yz-x^2=10(xz-y^2)$ does not hold since LHS is negative while RHS is positve.

If $x\lt z\lt y$, then $yz-x^2=10(xz-y^2)$ does not hold since LHS is positive while RHS is negative.

  • If $x^2\equiv 1\pmod{10}$, then $yz=21$ and so $(y,z)=(3,7),(7,3)$ each of which doesn't satisfy $(5)$.

  • If $x^2\equiv 4\pmod{10}$, then $yz=4,14,24,54$ and so $(y,z)=(1,4),(4,1),(7,2),(3,8),(4,6),(6,4),(6,9),(9,6)$ where only $(y,z)=(6,4),(9,6)$ satisfy $(5)$ with $x=8,12$ respectively. (we don't need to consider the case $(y,z)=(2,7)$ since then $x=8$ for which $y\lt z\lt x$ holds. Also, we don't need to consider the case $(y,z)=(8,3)$ since then $x=2$ for which $x\lt z\lt y$ holds.)

  • If $x^2\equiv 9\pmod{10}$, then $yz=9$ and so $(y,z)=(1,9),(9,1)$ each of which doesn't satisfy $(5)$.

  • If $x^2\equiv 6\pmod{10}$, then $yz=6,16,36,56$ and so $(y,z)=(1,6),(6,1),(3,2),(2,8),(8,2),(4,9),(9,4),(7,8)$ where only $(y,z)=(3,2)$ satisfies $(5)$ with $x=4$. (we don't need to consider the case $(y,z)=(2,3)$ since then $x=4$ or $6$ for which $y\lt z\lt x$ holds. Also, we don't need to consider the case $(y,z)=(8,7)$ since then $x=4$ or $6$ for which $x\lt z\lt y$ holds.)

  • If $x^2\equiv 5\pmod{10}$, then $x=5$ and one of $y,z$ is $5$, which does not satisfy $(2)$.

So, the only solutions are $$\color{red}{(x,y,z)=(4,3,2),(8,6,4)}$$ where we have $$\frac{243}{324}=\frac{324}{432}=\frac 34=\frac{486}{648}=\frac{648}{864}$$

Solution 2:

Not a complete answer but can be open for further discussion

See one famous example for cyclic number:

$$\frac{1}{7}=0.\overline{142857}$$

we have

$$142857:285714:428571:571428:714285,857142=1:2:3:4:5:6$$

You may pick up $1:2:4$ for a case of $6$ digits.

In general for base $b$, the cyclic-permutation decimal can be in the form of

$$\frac{b^{p-1}-1}{p}$$

Besides the cyclic numbers mentioned in the above link, a number of subsets of $\dfrac{k}{37}$ give further kinds of cyclic numbers (including $0$):

  • $k\in \{ 1,10,26 \}$ gives $0.\overline{027},0.\overline{270},0.\overline{702}$

  • $k\in \{ 2,15,20 \}$ gives $0.\overline{054},0.\overline{405},0.\overline{540}$

  • $k\in \{ 3,4,30 \}$ gives $0.\overline{081},0.\overline{108},0.\overline{810}$

  • $k\in \{ 5,13,19 \}$ gives $0.\overline{135},0.\overline{351},0.\overline{513}$

  • $k\in \{ 6,8,23 \}$ gives $0.\overline{162},0.\overline{216},0.\overline{621}$

  • $k\in \{ 7,33,34 \}$ gives $0.\overline{162},0.\overline{216},0.\overline{621}$

  • $k\in \{ 9,12,16 \}$ gives $0.\overline{243},0.\overline{324},0.\overline{432}$

  • $k\in \{ 11,27,36 \}$ gives $0.\overline{297},0.\overline{729},0.\overline{972}$

  • $k\in \{ 14,29,31 \}$ gives $0.\overline{378},0.\overline{783},0.\overline{837}$

  • $k\in \{ 17,22,35 \}$ gives $0.\overline{459},0.\overline{594},0.\overline{945}$

  • $k\in \{ 18,24,32 \}$ gives $0.\overline{486},0.\overline{648},0.\overline{864}$

  • $k\in \{ 21,25,28 \}$ gives $0.\overline{567},0.\overline{675},0.\overline{756}$

Only subsets $\{ 9,12,16 \}$ and $\{ 18,24,32 \} $ are your favourable cases.

Note that $27\times 37=999$

  • For $k=3n$, $$\frac{k}{27} = 0.\overline{n}$$

  • For other $k$ values, there're $6$ triplets of cyclic numbers but there're no favourable cases here.