Find x,y & z (xyz+xyz=zyx)

15.1k Views Asked by At

I saw this problem the other day at work and found it pretty interesting:

$$xyz + xyz = zyx$$

Find $x, y, z$ and the base(s) which this is true.

Note that $x,y,z$ are simply digits concatenated, they are not multiplied against each other. I ended up writing a program to brute force all solutions with base 2 - base 36. I left out $x=0,y=0,z=0$ since that seems trivial to me.

The solutions I found are below (I included the b10 value of xyz for reference):

x=0,y=1,z=1,b=2,  ->b10 value=3
x=1,y=4,z=3,b=5,  ->b10 value=48
x=2,y=7,z=5,b=8,  ->b10 value=189
x=3,y=a,z=7,b=11, ->b10 value=480
x=4,y=d,z=9,b=14, ->b10 value=975
x=5,y=g,z=b,b=17, ->b10 value=1728
x=6,y=j,z=d,b=20, ->b10 value=2793
x=7,y=m,z=f,b=23, ->b10 value=4224
x=8,y=p,z=h,b=26, ->b10 value=6075
x=9,y=s,z=j,b=29, ->b10 value=8400
x=a,y=v,z=l,b=32, ->b10 value=11253
x=b,y=y,z=n,b=35, ->b10 value=14688

Looking at the solution set, I noticed a few relationships which surprised me:

  • $x$ is valid for integers [0-11]
  • $y = 3x+1$
  • $z = 2x+1$
  • $R\text{ ($xyz$ in base 10)} = 9x^3 + 21x^2 + 15x + 3$

Are these formula's just chance? Or can they actually be derived without knowing the solution set ahead of time?

I started trying to work out a general solution and got stuck pretty fast:

$$2xb^2 + 2by + 2z = zb^2 + by + x$$

And then I stopped because I didn't understand how to find four unknowns with one equation. Thoughts?

1

There are 1 best solutions below

0
On BEST ANSWER

Th e equation you described can be written: $$2xb^2 + 2by + 2z = zb^2 + by + x$$ with the constraint $0\leq x,y,z \leq b-1$ now the first thing to do is to find $z$, we have $2z=x\mod b$ so we have two cases :

  • $z\leq \frac{b-1}{2}$ and hence $x=2z$ and in this case we have: $2xb+2y=zb+y$ and from here we have again $y\equiv 2y\mod b$ hence $y=0$ and $4z=z$ so $z=0$ there is no solution other then $xyz=000$
  • $z>\frac{b-1}{2}$ and hence $x=2z-b$ here we replace in the equation: $2xb+2y=zb+y-1$ but here again we have $2y\equiv y-1\mod b$ hence $y=b-1$ and $2x+1=z$ so $4z-2b+1=z$ hence $3z=2b+1$ so here we have two cases:
    • If $3$ does not divide $2b-1$ no solution
    • If $3$ divides $2b-1=3k$ then $z=k$ and $x=2k-b$ and hence:$xyz=(2k-b)b^2+(b-1)b+k=\frac{b^3+b^2-b-1}{3}$

Conclusion:

  • $2b-1$ divisible by $3$ the only solution $\overline{xyz}^{(b)}$ is the number $\frac{b^3+b^2-b-1}{3}$ with the values ($x=\frac{b-2}{3},y=b-1,z=\frac{2b-1}{3}$)
  • Otherwise no solution.

This formula works for your given values, and if you want to find the value of $x$ you can replace in the equations $b=3x+2$ so that you obtain: $$b=3x+2,y=3x+1,z=2x+1, R=9x^3+21x+15x+3$$