3

Recently, I have found this problem:

Given two natural numbers $m$ and $n$, find the number of tuples $(m,n)$ such that: $$m+n=\text{gcd}(m,n)+\text{lcm}(m,n)=9!$$

I hav completely no idea of how to do it because I am used to operate with the formula $\text{gcd}(m,n)\cdot\text{lcm}(m,n)$ and not with the sum $\text{gcd}(m,n)+\text{lcm}(m,n)$.

In order to escape from this problem, I have tried to set $n=9!-m$ and then substitute for $n$, but here I am stuck agian because I have to work with: $$\text{gcd}(m,9!-m)+\text{lcm}(m,9!-m)$$

Any idea of how to proceed? Thanks.

Matteo
  • 6,581

2 Answers2

3

I’ll get you started. Let $d=\operatorname{gcd}(m,n)$, and let $m'=\frac{m}d$ and $n'=\frac{n}d$. Then $\operatorname{gcd}(m',n')=1$ and $\operatorname{lcd}(m,n)=dm'n'$, so

$$m'+n'=1+m'n'=\frac{9!}d\;.$$

Now

$$\begin{align*} 0&=(1+m'n')-(m'+n')\\ &=m'n'-m'-n'+1\\ &=(m'-1)(n'-1)\;, \end{align*}$$

so $m'=1$ or $n'=1$. Can you take it from here?

Brian M. Scott
  • 616,228
1

Let $\gcd(m,n) = d$. Let $\frac md = m'$ and $\frac nd = n'$. We know $\gcd(m',n')=1$.

The we have $m+n = d(m'+n')$ and

$\gcd(m,n) + \operatorname{lcm}(m,n) = d + \frac {mn}d = d+m'n'd = d(1+m'n')$

And $9! =2^7*3^3*5*7$

So $m'+n' = 1+m'n'$. If we consider the lesser one of $m',n'$ to be $a$ and the larger to be $b$ we have. Then $1+ab = a+b \le 2b$ so $\frac 1{b} + a \le 2$ so $a< 2$ so $a = 1$ and $m=d$

so we have $m(1+n') = 2^7*3^3*5*7$.

So we can have any $m|9!$ and $n= m(\frac {9!}m -1)= 9!-m$.

Verify ...

If $m|9!$ and $n = 9!-m$ then $m+n = m + (9!-m) = 9!$. Check.

We know $m|m$ and no higher number than $m$ divides $m$. And if $m|9!$ then $m|9!-m$ so $m$ is a common divisor of $m$ and $n$ and $m$ is the greatest common divisor so $\gcd(m,n) + \operatorname{lcm}(m,n)= m + \frac {mn}m = m+ n = 9!$. Check.

Yup those are the answers.

Now how many $(n,m)$ pairs are there.

Well if we consider that $m|9!$ and $n = 9!-m$ we have $9!=2^7*3^4*5*7$ so $9!$ has $(7+1)(4+1)(1+1)(1+1)=8*5*2*2 = 160$ possible factors. But we can't have $m=9!$ and $n=9!-9!=0$. So there are $159$ pairs $(m,n)$ where $m|9!$ and $n=9!-m \ge 1$. But we also have $159$ pairs $(m,n)$ where $n|9!$ and $m=9!-n$. And those two sets will have the pair $(m,n)$ in common if both $m|9!;m\ne 9!$ and $n=9!-m|9!$.

Bur $m|9!$ and $m\ne 9!$ means $1\le m\le \frac {9!}2$ so $n=9!-m\ge \frac {9!}2 < 9!$ but $n|9!$ so that means $n=m=\frac {9!}2$.

So there are $2*159-1= 317$ such pairs.

fleablood
  • 124,253
  • I checked the answer and that was $317$. Why? Have you commited some errors? – Matteo Jun 18 '20 at 06:59
  • the answer to what was 317? you had to solve for both $n$ and $m$ – fleablood Jun 18 '20 at 15:27
  • But if $n = 317$ which is prime, then $m = 9!-317=362563= 3741239$. The $\gcd(m,n)=1$ and then $lcm(m,n) = 317*362563=114932471$ and $1+114932471=114932472\ne 9!$ so no, that is not a solution. – fleablood Jun 18 '20 at 15:33
  • No, I was referring to the numer of pairs $(n.m)$ solutions to the equation. – Matteo Jun 18 '20 at 17:41
  • Lessee: $123456789=24839657=2^73^{\color{red}4}57$ so I made one error. And so there are $(7+1)(\color{red}4 + 1)(1+1)(1+1)=852*2=160$ factors that $m$ can be and $n=9!-m$ can be anything but $0$ so $m\ne 9!$ so $159$ possible pairs of solutions. If I made another error I don't see where. – fleablood Jun 18 '20 at 18:10
  • But $317 = 2*160 - 3$.... so... oh, I see. I was distinguishing $m|9!$ and $n= 9!-m$ when I should have also had $n|9!$ and $m=9!-n$. So that doubles the number from $159$ to $318$ and the case where $m=n = \frac {9!}2$ is double counted so the answer is $317$ solutions. – fleablood Jun 18 '20 at 18:23