Is this the general solution to $m\mid n^2+n, n\mid m^2+m$?

166 Views Asked by At

Is this the general solution to $m\mid n^2+n, n\mid m^2+m$?

I saw this problem in this Michael Penn video:

https://www.youtube.com/watch?v=0J1ByEhwHRU

Here is my solution (which is very different than the solution in the video):

Let $uv=c^2+1$. Then $m=c(u+c), n=c(v+c) $.

My question:

Are these the general solutions?

Note: all variables are positive integers.

Verification:

$\begin{array}\\ m^2+m &=m(m+1)\\ &=c(u+c)(c(u+c)+1)\\ &=c(u+c)(cu+c^2+1)\\ &=c(u+c)(cu+uv)\\ &=cu(u+c)(c+v)\\ &=nu(u+c)\\ n^2+n &=n(n+1)\\ &=c(v+c)(c(v+c)+1)\\ &=c(v+c)(cv+c^2+1)\\ &=c(v+c)(cv+uv)\\ &=cv(v+c)(c+u)\\ &=mv(v+c)\\ \end{array} $

3

There are 3 best solutions below

3
On BEST ANSWER

In Thomas Andrews' answer, using $c=\gcd(m,n)$ so $m=cm_0$ and $n=cn_0$ with $\gcd(m_0,n_0)=1$, there's the result, for $m_0\neq n_0$, of

$$m_0n_0\mid (m_0+n_0)c+1 \tag{1}\label{eq1A}$$

Also, since $m_0$ and $n_0$ are coprime, then $m_0=n_0$ means they're both $1$, so \eqref{eq1A} holds in that case as well. This equation shows that, for some integer $k \ge 1$, we have

$$\begin{equation}\begin{aligned} (m_0+n_0)c+1 & = km_{0}n_{0} \\ kcm_0 + kcn_0 + k & = k^{2}m_{0}n_{0} \\ c^2 + k & = k^{2}m_{0}n_{0} - kcm_0 - kcn_0 + c^2 \\ c^2 + k & = (km_0 - c)(kn_0 - c) \end{aligned}\end{equation}\tag{2}\label{eq2A}$$

Your result is a special case with $k = 1$. A more general solution is for any $k \ge 1$ where

$$uv = c^2 + k \tag{3}\label{eq3A}$$

so using $u = km_0-c$ and $v=kn_0-c$ in \eqref{eq2A}, we require $k \mid u+c$ and $k \mid v+c$. Then

$$m = \frac{c(u+c)}{k}, \; n = \frac{c(v+c)}{k} \tag{4}\label{eq4A}$$

is a solution. Similar to what you did, the verification is

$$\begin{equation}\begin{aligned} m^2 + m & = m(m + 1) \\ & = \left(\frac{c(u+c)}{k}\right)\left(\frac{c(u+c)}{k}+1\right) \\ & = \frac{c(u+c)(c(u+c)+k)}{k^2} \\ & = \frac{c(u+c)(cu+c^2+k)}{k^2} \\ & = \frac{c(u+c)(cu+uv)}{k^2} \\ & = \frac{uc(u+c)(c+v)}{k^2} \\ & = \left(\frac{c(c+v)}{k}\right)\left(\frac{u(u+c)}{k}\right) \\ & = n\left(\frac{u(u+c)}{k}\right) \end{aligned}\end{equation}\tag{5}\label{eq5A}$$

Since $k\mid u+c$, then $\frac{u(u+c)}{k}$ is an integer. We can also similarly verify that $n^2+n = m\left(\frac{v(v+c)}{k}\right)$.


As indicated in Thomas Andrews' comment, with $k = 2$, then for every odd $c$, since $c^2 + k$ is odd, then all factors $u$ and $v$ are as well, so $k$ always divides $u+c$ and $v+c$. Also, this produces results not obtainable using $k=1$, with the first such one being $(c,k,u,v)=(1,2,3,1)$ giving $(m,n)=(2,1)$.

For each larger $k$, since $1$ is always a factor, then any positive $c \equiv -1 \pmod{k}$ works by choosing $u = 1$ and $v = c^2 + k$. For $k = 2$, using the odd factors $u$ and $v$ of $c^2 + 2$ for any odd $c$ comprise all of the solutions while, for $k \gt 2$, there are also many other $c$, $u$ and $v$ which work, especially for smaller $k$ values.

Also, for any $k$ where there's a solution of $c$ with $k \gt 2c + 1$, then there's also at least one $c_1 \gt c$ and $0 \lt k_1 \lt k$ where $c^2 + k = c_1^2 + k_1$ (at times also including the OP's result of $k_1 = 1$), so some solutions may be repeated.

0
On

Just a start.

Given any solution, let $c=\gcd(m,n).$

Then $m=cm_0,n=cn_0$ with $\gcd(m_0,n_0)=1.$

Now, $m_0\mid n_0(cn_0+1)$ and $n_0\mid m_0(cm_0+1).$ Since $\gcd(m_0,n_0)=1,$ this means:

$$m_0\mid cn_0+1, n_0\mid cm_0+1.\tag1$$

From this alone, we deduce $n_0,m_0,c$ are pairwise relatively prime. And from $c,m_0,n_0$ satisfying $(1)$ alone, we can deduce $m=cm_0,n=cn_0$ is a solution to your question.

To get your result, we need to deduce from $(1)$ that $(m_0-c)(n_0-c)=c^2+1,$ or $$m_0n_0-c(m_0+n_0)=1.$$

Don't see where to go from there.


Further, less definitive ideas

From $(1)$ we deduce that $m_0n_0\mid cn_0^2+n_0$ and $m_0n_0\mid cm_0^2+m_0.$ So:

$$m_0n_0\mid (n_0^2-m_0^2)c+(m_0-n_0)$$

But $m_0,n_0$ are both relatively prime to $m_0-n_0,$ so this means, if $m_0\neq n_0:$

$$m_0n_0\mid (m_0+n_0)c+1.$$

0
On

$\frac{m}{(n,m)}$ divides $(n+1)$

$\frac{n}{(n,m)}$ divides $(m+1)$

$\frac{n}{(n,m)} \ell_1 = (m+1) \implies \frac{n}{(n,m)} \ell_1 = \frac{(n+1)(n,m)}{\ell_2}+1 \implies n_1 \ell_1 = \frac{(n_1 n_2+1)n_2}{\ell_2}+1 \implies n_1 = \frac{\left(n_2+\ell_2\right)}{\ell_1 \ell_2-n_2^2}$

where $(\ell_2,n_2) = 1$.

Any $n_2$ for which we can find $\ell_1,\ell_2$ with $(\ell_2,n_2) = 1$ such that $$n_1 = \frac{\left(n_2+\ell_2\right)}{\ell_1 \ell_2-n_2^2}$$ is an integer gives a solution by setting: $$n = n_1n_2$$ $$m = \frac{(n+1)n_2}{\ell_2}$$

Hence $(\ell_1,n_2) = 1$.

Let, $$k = \ell_1 \ell_2-n_2^2$$ This gives, $$n_1 = \frac{\left(n_2+\ell_2\right)}{k}$$ Assume $\ell_1$ chosen such that $k$ divides $n_2+\ell_2$.

Let $c = n_2$, then Solution is: $$n = n_1 n_2 = \frac{c(c+\ell_2)}{k}$$ $$m = \frac{(n+1)c}{\ell_2}$$

where $$k = \ell_1 \ell_2 - c^2$$ and $$k \ divides \ c+\ell_2$$

Hence fix $c,k$, if we can choose $\ell_1,\ell_2$ such that $$k = \ell_1 \ell_2 - c^2$$ $$k \ divides \ c+\ell_2$$

then we get a solution.

Coming to the Question, Choose $$u = \ell_1$$, $$v=\ell_2$$ and $k>1$ to get a new family of solutions.

This idea to reparamerterize my equations interms of $k = \ell_1 \ell_2 - c^2$ and $u = \ell_1$, $v = \ell_2$ is inpspired by answer from John Omielan.

An example, new family of solutions: $$m = c$$ $$n = \frac{c(c+1)}{r}$$.

where $r$ divides $c+1$.