Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let $m,n$ be integers. I want to find the possible values of $m,n$ such that $4(m+n)\over (2m+n)^2+3n^2$ and $4n\over (2m+n)^2+3n^2$ are both integers too. Would someone please help? Of course letting $(2m+n)^2+3n^2=4$ gives some good values, but is this all the $m,n$ I can get?

Added: I can see that the problem can be reduced to asking for $4k\over (2m+n)^2+3n^2$ to be an integer for both $k=m,n$

share|cite|improve this question
$(2m+n)^2 + 3n^2 = 1$ has no solutions. The only way the sum of two squares can be 1 is if one is 1 and one is 0. $3n^2$ can never be 1, so it must be 0, i.e., $n = 0$. Now the other one becomes $4m^2$ which can not be 1. – Graphth Feb 13 '12 at 19:53
@Graphth: I am sorry, I have actually edited it, it is a typo, I meant $4$ not $1$ – frac Feb 13 '12 at 19:54
$(2m + n)^2 + 3n^2 = 4m^2 + 4mn + 4n^2 = 4(m^2 + mn + n^2)$. So, you can just cancel the 4s. – Graphth Feb 13 '12 at 19:58
Also, since it's symmetric in $m$ and $n$, you can assume one is bigger than the other. Also, the only possible solutions must involve the smaller one being 0 or negative. – Graphth Feb 13 '12 at 20:02
By simplifying or not, we can see that the bottom is fatally bigger than the top except in trivial cases. Are you sure this is the problem? Where does it come from? – André Nicolas Feb 13 '12 at 20:15
up vote 3 down vote accepted

We find all integer values of $m$ and $n$ such that $\frac{4n}{(2m+n)^2+3n^2}$ is an integer. Once this is done, your problem that imposes additional conditions is easily solved.

If $3n^2 > 4n$, then the bottom has absolute value greater than the absolute value of the top. Thus all but $n=0$, $n=\pm 1$ are immediately ruled out.

If $n=0$, we are looking at $\frac{0}{4m^2}$, which is an integer for all non-zero $m$.

If $n=1$, then we are looking at $\frac{4}{4m^2+4m+4}$, or equivalently at $\frac{1}{m^2+m+1}$. This is an integer only in the cases $m^2+m+1=\pm 1$. The equation $m^2+m+1=1$ has the solutions $m=0$ and $m=-1$. The equation $m^2+m+1=-1$ has no real solutions, let alone integer solutions.

By a similar argument, or by symmetry, the case $n=-1$ gives the solutions $m=0$ and $m=-1$.

So for integer values of $n$ and $n$, $\frac{4n}{(2m+n)^2+3n^2}$ is an integer precisely in the following cases:

(i) $n=0$, $m$ arbitrary non-zero; (ii) $n=1$, $m=0$ or $m=-1$; and (iii) $n=-1$, $m=0$ or $m=1$.

share|cite|improve this answer
Yes, I wasn't clear on that on first reading; sorry. Alternatively, we can note that the difference between first and second gives a perfectly symmetric problem on $n$ and $m$. – Arturo Magidin Feb 13 '12 at 21:25
Thanks, why can $m$ be an arbitrary non-zero when $n=0$? Sure $\frac{4n}{(2m+n)^2+3n^2}=\frac{0}{4m^2}$ is an integer for any non-zero $m$ but we also need $\frac{4m}{(2m+n)^2+3n^2}={1\over m}$ to be an integer, no? – frac Feb 13 '12 at 22:19
@frac: Yes. At the beginning of my answer, I say that I am only dealing with the condition that $\frac{4n}{(2m+n)^2+3n^2}$ is an integer. Once that is dealt with, you can scan the solutions to see whether they satisfy your additional condition that involves $m+n$. For $n=0$ that forces $m=\pm 1$. The other solutions, involving $n=\pm 1$, satisfy your additional condition. – André Nicolas Feb 13 '12 at 22:26

Since $(2m+n)^2 + 3n^2 = 4m^2 + 4mn + n^2 + 3n^2 = 4m^2 + 4mn + 4n^2$, then $$\frac{4(m+n)}{(2m+n)^2+3n^2} = \frac{4(m+n)}{4m^2+4mn+4n^2} = \frac{m+n}{m^2+mn+n^2}.$$ Similarly, $$\frac{4n}{(2m+n)^2+3n^2} = \frac{4n}{4m^2+4mn+4n^2} = \frac{n}{m^2+mn+n^2}.$$ For both to be integers, you need $m^2+mn+n^2$ to divide both $m+n$ and $n$; hence, it must divide both $m$ and $n$.

If $mn\gt 0$, then this is clearly impossible, since then $m^2+mn+n^2$ is strictly larger than each of $m$ and $n$ (as they are all integers). So $m$ and $n$ cannot both be positive or both be negative.

If $m=0$ or $n=0$, then you have that $m^2$ divides $m$, or $n^2$ divides $n$, hence you must have $(m,n) = (0,\pm 1)$ or $(\pm 1,0)$.

So we are now reduced to the case where one of $m,n$ is negative and one is positive. Let us say, without loss of generality that $m\lt 0\lt n$. If $|m|\lt n$, then $mn\lt n^2$, so $m^2+mn+n^2 \gt m^2 \geq |m|$; so $m^2+mn+n^2$ cannot divide $m$. If $|m|\gt |n|$, then $-m\gt n$, so $-m^2\lt mn$; hence $m^2+mn\gt 0$, so $m^2+mn+n^2\gt n^2\geq n$; hence $m^2+mn+n^2$ cannot divide $n$.

Finally, if $|m|=n$, then $mn=-n^2$, so $m^2+mn+n^2 = m^2 = n^2$; this divides $n$ if and only if $n=1$. So another solution is $(m,n) = (\pm 1,\mp 1)$, in which case your first fraction is $0$, and your second fraction is $1$.

share|cite|improve this answer

We can't have $m=n=0$. Let's suppose for a moment that $n=0$ then (using Graphth's answer) $n/(m^2+mn+n^2)=0$ and $m/(m^2+mn+n^2)=1/m$ and $1/m$ is integer only if $m=-1$ or $m=1$. Since the problem is symmetric in $m$ and $n$ we found the solutions $(m,n)=(0,-1),(0,1),(1,0),(-1,0)$.

We know that if $a|b$ and $a,b\neq0$ then $|a|\le|b|$. Since $m^2+mn+n^2$ is always positive, we can say $m^2+mn+n^2\le |n|$ and since $|n|\le n^2$ for $n\in\mathbb{Z}$ we have $m^2+mn+n^2\le n^2$ then $m^2+mn\le 0$. Analogously $mn+n^2\le 0$. Summing up we get $m^2+2mn+n^2\le0$ or $(m+n)^2\le 0$. This inequality is only true if $(m+n)=0$. Now suppose $m=-n$. We get that $m^2=m^2+mn+n^2|m$ then $m=1$ or $m=-1$. Using the symmetry we get two more solutions $(m,n)=(1,-1),(-1,1)$.

share|cite|improve this answer

I wrote small Maple program that search for possible solutions :

for n from -1000 to 1000 do
for m from -1000 to 1000 do
if not(m = 0 and n = 0) then
b:=(4*n )/((2*m+n)^2+3*n^2):
if type(a,integer) and type(b,integer) then
end if;
end if;
end do;
end do;

It seems that there are only four pairs :

$(m,n)=(0,-1) , (m,n)=(-1,0) , (m,n)=(1,0) , (m,n)=(0,1)$


As Arturo rightly observed pairs :

$(m,n)=(-1,1) , (m,n)=(1,-1)~$ are also solutions .

share|cite|improve this answer
Thanks, but surely $(0,1)$ and $(1,0)$ are also solutions? – frac Feb 13 '12 at 20:27
And also $(\pm 1,\mp 1)$. – Arturo Magidin Feb 13 '12 at 20:28

Hint: put $k = m^2+mn+n^2$. Reducing fractions shows $k\ |\ m+n,n\ \Rightarrow \ k\ |\ (m+n,n) = (m,n)$.

But $\:(m,n)^2\:|\: k\ |\ (m,n)$ so $(m,n) = 1,\ k = \pm 1$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.