# Function of two integers

• I
{???}
TL;DR Summary
For the function f(m,n)=m^2n^2/[(m+n)(m-n)], are there two distinct pairs of integers (m1,n1), (m2,n2) such that f(m1,n1)=f(m2,n2)?
Hello all,

This is a problem of a different flavour from my usual shenanigans. I'm looking at a function
$$f(m,n)=\frac{m^2n^2}{(m+n)(m-n)}$$
and am trying to determine if there are any two pairs of values ##(m_1,n_1)## and ##(m_2,n_2)## which evaluate to the same result. Assume that ##m_i>n_i## for ##i=1,2##.

I've made a massive table in Google sheets that calculates the fraction (well, reduced numerator and denominator) for values of ##m,n## between ##1## and ##99## (!). I don't see any matches but I'm not convinced there can't be any.

So I've tried to prove the following: If ##f(m_1,n_1)=f(m_2,n_2)## then ##m_1=m_2## and ##n_1=n_2##.

It seems like the best approach is using modular arithmetic (I'm most familiar with dealing with squares mod 10). I would write
$$m_2^2=\frac{m_1^2n_1^2(m_2^2-n_2^2)}{n_2^2(m_1^2-n_1^2)}$$
and then maybe try to show that the RHS is not the square of an integer unless ##m_1=km_2## and ##n_1=kn_2##.

Alternatively, I can use the fact that if ##m_1,n_1## are relatively prime, then ##m_1\pm n_1## is relatively prime to both of them. But then I get something which depends on the prime factors of ##m_1## and ##n_1##. I don't really know how to proceed - this is probably something number theory can help with and is outside my domain of expertise.

Any suggestions?

Thanks,
QM

EDIT 1: I think I see another way forward. Given ##m_1,n_1##, we have ##f(m_1,n_1)=N/D## for integers ##N,D##; then ##f(Dm_1,Dn_1)=DN## which is an integer. Maybe I can show that these integers are all distinct...

EDIT ##e##: I don't think that's the best way forward anymore. I'm going to try making my argument clear with a simplified case.

EDIT ##\pi##: Okay, here's the best I've got.

I want to prove the following claim:

If ##a,b,c,d## are integers and ##a^{-1}-b^{-1}=c^{-1}-d^{-1}##, then ##a=c## and ##b=d##.

Now, we can rearrange to get ##d^{-1}=c^{-1}+b^{-1}-a^{-1}##, so
$$d=\frac{abc}{ab+ac-bc}.$$
If ##a=c##, then ##ab-bc=0## and ##d=b##. Otherwise assume ##a\neq c##.

Also assume that ##\mathrm{gcd}(a,b,c)=1##. Then ##ab+ac-bc## is not a multiple of ##ab,c## (write it as ##ab+(a-b)c##), ##ac,b## (##ac+(a-c)b##), or ##bc,a## (##a(b+c)-bc##). Therefore ##\frac{abc}{ab+ac-bc}## can only be an integer if ##ab+ac-bc## takes some factors of ##a,b,c## but not the ones needed to form a multiple of one of ##a,b,c,ab,ac,bc##.

I believe I can conclusively prove the lemma for primes and squares of primes, but I need to have a think about how to get from there to arbitrary squares ##a,b,c,d##. My rigourous maths is a bit rusty.

EDIT ##\delta_\mathrm{feigenbaum}##: I don't think my primes argument holds water.

Suppose ##a,b,c,d## are primes and ##a^{-1}-b^{-1}=c^{-1}-d^{-1}##. Then

$$d=\frac{abc}{ab+ac-bc}.$$

Therefore ##ab+ac-bc## is one of ##1,a,b,c,ab,ac,bc,abc##.

If ##ab+ac-bc=ab## then ##a=b## (trivial case).

If ##ab+ac-bc=ac## then ##a=c## (what we started with).

If ##ab+ac-bc=bc## then ##2bc=a(b+c)##. But then either ##a=2## (so ##bc=b+c## and therefore ##a=b=c=2##), ##a=b## (trivial case), or ##a=c## (what we started with).

If ##ab+ac-bc=a## then ##a(b+c-1)=bc##. Either ##a=b## or ##a=c##.

If ##ab+ac-bc=b## then ##b(a-c-1)=ac##. Then ##b=a## (if ##b=c## then ##-c^2=c## which is impossible).

If ##ab+ac-bc=c## then ##c(a-b-1)=-ab##. Then ##c=a## or ##c=b##. (?)

If I can get this lemma for primes, I can get it for squares of primes using the difference of two squares formula. But then I need to generalize it to arbitrary integer squares.

I'm stuck (and also out of clever constants whose integer truncations are consecutive integers). Any help would be appreciated.

Last edited:

Gold Member
$$\frac{1}{f(m,n)}=\frac{1}{n^2}-\frac{1}{m^2}=2\int_n^m x^{-3}dx$$
It is not a proof but probable that there are no other integers (n, m) sets to give the same value.

EDIT　Multiplying Rydberg constant RH to this formula we get formula for inverse of wave length of radiated lights from Hydrogen. As post #3 suggests we may not be able to identify unique initial state and final state by observing wave length of radiated light in some cases.

Last edited:
Mentor
f(5,9)=f(6,90)
f(5,7)=f(7,35)

I find 14 more matches with n,m <= 100, although some of them are trivial (multiples of smaller matches).

anuttarasammyak and PeroK
Gold Member
f(5,9)=f(6,90)
f(5,7)=f(7,35)
Say
$$f(n_1,m_1)=f(n_2,m_2)$$
then
$$f(n_1,n_2)=f(m_1,m_2)$$
so
$$f(5,6)=f(9,90)$$

Last edited:
{???}
f(5,9)=f(6,90)
f(5,7)=f(7,35)

I find 14 more matches with n,m <= 100, although some of them are trivial (multiples of smaller matches).

Say
$$f(n_1,m_1)=f(n_2,m_2)$$
then
$$f(n_1,n_2)=f(m_1,m_2)$$
so
$$f(5,6)=f(9,90)$$

Wow, good on you guys for finding some working counterexamples!

Any chance you can provide the complete list of matches you found (including the trivial multiples)? I would like to see if the domain of validity of my partial proof was right - that is, any match must fall within one of the cases I could not prove.

And, yeah, you're absolutely right, both about this having everything to do with hydrogen atoms and about your conclusion that you cannot uniquely identify the transition using the wavelength of emitted light.

Thanks,
QM

Homework Helper
Gold Member
2022 Award
Any chance you can provide the complete list of matches you found (including the trivial multiples)?
Just write a program or use a spreadsheet.

Mentor
Nice observation @anuttarasammyak

The way I wrote the program it's awkward to reconstruct n,m but you can search for these function values in your spreadsheet:

36.1607142857 <- f(5,9)=f(6,90)
51.0416666667 <- f(5,7)=f(7,35)
64.8
65.3333333333
81.8181818182 <- f(5,6) =f(9,90)
82.2857142857
126.041666667
204.166666667
209.066666667
352.8
496.125
576.19047619
1376.19047619
2962.28571429
3600.0
4064.0625
Quick and dirty python code:
Code:
def fnm(n,m):
return 1.*n*n*m*m/((n+m)*(m-n))

values=[]
for n in range(1,100):
for m in range(n+1,100):
values.append(fnm(n,m))
values.sort()

lastval=-1
for val in values:
if abs(val-lastval)<1E-8:
print(val)
lastval=val

PeroK
{???}
mfb, I've edited the quote below to fill in the other pairs from my spreadsheet:
Nice observation @anuttarasammyak

The way I wrote the program it's awkward to reconstruct n,m but you can search for these function values in your spreadsheet:

36.1607142857 <- f(5,9)=f(6,90)
51.0416666667 <- f(5,7)=f(7,35)
64.8 <- f(6,9)=f(8,72)
65.3333333333 <- f(7,14)=f(8,55)
81.8181818182 <- f(5,6) =f(9,90)
82.2857142857 <- f(6,8)=f(9,72)
126.041666667 <- f(10,22)=f(11,55)
204.166666667 <- f(10,14)=f(14,70) (multiple)
209.066666667 <- f(7,8)=f(56,14)
352.8 <- f(14,21)=f(18,63)
496.125 <- f(14,18)=f(21,63)
576.19047619 <- f(10,11)=f(22,55)
1376.19047619 <- f(30,51)=f(34,85)
2962.28571429 <- f(36,48)=f(45,80)
3600.0 <- f(36,45)=f(48,80)
4064.0625 <- f(30,34)=f(51,85)

Also, if we no longer restrict to ##m,n<100##, then in fact there is an easy way to construct infinitely many of these pairs.

Since ##3^2+4^2=5^2## we have ##\frac{1}{20^2}+\frac{1}{15^2}=\frac{1}{12^2}##. Multiplying through by ##n^{-2}## and rearranging gives
$$\frac{1}{(12n)^2}-\frac{1}{(15n)^2}=\frac{1}{(20n)^2}.$$
Likewise,
$$\frac{1}{(12m)^2}-\frac{1}{(20m)^2}=\frac{1}{(15m)^2}.$$

Take ##n=3k,m=4k## to get

$$\frac{1}{(36k)^2}-\frac{1}{(45k)^2}=\frac{1}{(60k)^2}=\frac{1}{(48k)^2}-\frac{1}{(80k)^2}.$$

It is trivial to see how this generalizes to the other Pythagorean triples; we just divide by the product of the sides of the triangle, move each leg to the other side separately, scale up the single remaining term until we reach the LCM, and voila.

In fact, we should be able to get triply degenerate wavelengths or higher (now that my secret underlying physics motivation has been revealed!).

Huh. How about that? Number theory applied to physics after all!

Thanks all,
QM

mfb