5

The problem is to find all pairs of two distinct pairs(up to permutation) of integer(!) numbers $(a, b)$ and $(c, d)$ s.t. $$\operatorname{lcm}(a, b) = \operatorname{lcm}(c, d)$$ $$\gcd(a, b) = \gcd(c, d)$$ and $$\frac{a + b}{2} = \frac{c + d}{2}$$

It is easy to show that if both LCM and GCD are equal, then two pairs have the same product in absolute value and the same sum AND the same GCD.

There was a similar question on MathSE about natural numbers, answer to which is that such distinct pairs dont exist: Prove two distinct pairs of natural numbers with these properties do not exist

One such pair is ((-6; 35), (14;15)): their sums and LCMs and GCDs are all equal pairwise. How to find all such pairs?

Jam
  • 10,325
  • 3
    Note that this question asks about pairs of integer, whereas the cited question asks about pairs of natural numbers. Since negative numbers are members of $\mathbb Z$ but not $\mathbb N$, the seemingly different answers are not contradictory. – Keith Backman Aug 23 '19 at 16:02

4 Answers4

3

Given $\operatorname{lcm}(x,y)\cdot\operatorname{gcd}(x,y)=|xy|$, we have $\operatorname{lcm}(a,b)\cdot\operatorname{gcd}(a,b)=\operatorname{lcm}(c,d)\cdot\operatorname{gcd}(c,d)$, so $|ab|=|cd|$. Given $\frac{a+b}{2}=\frac{c+d}{2}$, we have $c=(a+b)-d$. When substituted into $|ab|=|cd|$, this gives the two quadratics $d^2-(a+b)d\pm ab=0$. These have the two pairs of solutions $d=a,b$ (when $c,d$ are trivially a permutation of $a,b$) and $d=\frac{(a+b)\pm\sqrt{\Delta}}{2}$, where $\Delta$ is the discriminant $a^2+6ab+b^2$.

In the nontrivial case, $d$ is integral if $(a+b)\pm\sqrt{\Delta}$ is integral (and even), therefore $\Delta$ is a square. Hence, for some integer $k$, the triple $(a,b,k)$ is a solution of the 3-variable, 2nd-degree Diophantine equation $a^2+6ab+b^2=k^2$. This can be solved with a method analogous to finding Pythagorean triples: consider the intersections of the hyperbola $a^2+6ab+b^2=1$ with the line $a=m(b-1)$. The first intersection is $(1,0)$ and the second intersection is guaranteed to be rational when $m$ is integral, which paves the way for integer solutions when clearing denominators. The second solution is $b=\frac{(m+1)(m-1)}{m^2+6m+1},a=\frac{-2m(3m+1)}{m^2+6m+1}$, which we can substitute into $a^2+6ab+b^2=1$ and multiply through by $(m^2+6m+1)^2$, to give solutions for $(a,b,k)$, and by extension $(a,b,c,d)$ when substituted into the earlier equations. So the set of nontrivial solutions up to multiples and permutations is, for $m\in\mathbb{Z}$

$a=-2m(3m+1)\\ b=(m+1)(m-1)\\ c=-(3m+1)(m+1)\\ d=2m(1-m)$

For example, $m=-5$ gives the solution $(-140,24,-56,-60)$, which is a multiple and permutation of the solution $(-6,35,14,15)$ mentioned by the asker. This encompasses all solutions.

Jam
  • 10,325
  • Followup: you can show that this is indeed all solutions as the hyperbola can be expressed as $r=-\frac{\left(2\cos\left(\theta\right)+6\sin\left(\theta\right)\right)}{\left(1+6\sin\left(\theta\right)\cos\left(\theta\right)\right)}$, which is $2\pi$-periodic so all rational points will be intersected by the line. You can also show that $\operatorname{gcd}(a,b)=\begin{cases}1,&m\equiv 0\mod 2\8,&m\equiv 1\mod 4\4,&m\equiv 3\mod 4\end{cases}$ so accounting for that gives coprime $a,b$ that can generate all other nontrivial solutions when multiplied by an integer $n$. – Jam Aug 25 '19 at 13:06
0

We could first search for $\gcd(a,b)=1$ since after that, multiply all of (a,b,c,d) by f so that $\operatorname{lcm}(af,bf)=\operatorname{lcm}(cf,df)=\operatorname{lcm}(a,b).f^2,\gcd(af,bf)=\gcd(cf,df)=f, af+bf=cf+df$.

Davide Giraudo
  • 172,925
Zhaohui Du
  • 1,816
0

We require $ab=-cd$ and $a+b=c+d$. (Note that the gcd condition is then automatically satisfied.)

Then $(c+a)(c+b)=c^2$.

So $c+a=2LM^2,c+b=LN^2,c=LMN$.

Then $a=LM(2M-N),b=LN(N-M),d=L(N-M)(N-2M)$.

-1

Given $\gcd(a,b)=1$, since $ab=cd$, assume $$(-a,c)=x, (-a,d)=y, (b,c)=z, (b,d)=w$$ we have $$a=-xy, b=zw, c=xz,d=yw$$ so that $zw-xy=xz+yw$ or $(z-y)w=x(y+z)$ so $x\mid z-y$ and $w\mid y+z$; $z(w-x)=y(x+w)$ $z\mid x+w$ and $y\mid w-x$.

Now let's assume that $w$ is largest (x,y,z,w are all positive integers) among x,y,z,w since $w\mid y+z$, we must have $w=y+z$ so next we got $z=x+y$ So given any integer number pairs $(x,y)$, we have $$x=x,y=y,z=x+y,w=2y+x$$ $$a=-xy, b=(x+y)(x+2y), c=x(x+y), d=y(x+2y)$$ is a result. And given any another integer $f$, we have $$a=-xyf, b=(x+y)(x+2y)f, c=x(x+y)f, d=y(x+2y)f$$ is a result

Zhaohui Du
  • 1,816
  • 1
    I don't understand how this answer is justified nor where $\operatorname{gcd}(a,b)=1$ comes from. Also $|ab|=|cd|$, not $ab=cd$. The pairs $(468,-78)$ and $(156,234)$ have the same gcd $(78)$, lcm $(468)$ and sum $(1070)$ but the gcd is not $1$ and $ab\neq cd$. – Jam Aug 23 '19 at 14:51
  • For your example, we could divid all integers by 78 to reach another solution (6,-1), (2,3) and this one satisfies the condition gcd(a,b)=1. – Zhaohui Du Aug 24 '19 at 05:08
  • And yes it should be |ab|=|cd| instead of ab=cd. Since we have assumed that a<0 and b,c,d is positive, it should be -ab=cd instead of ab=cd. – Zhaohui Du Aug 24 '19 at 05:09