I think taking logs is an unnecessary indirection in the given proof. If n^m = m^n then raising both sides to the power of 1/(nm) gives us n^(1/n) = m^(1/m). So we are looking for two distinct positive integers at which the function x ↦ x^(1/x) takes the same value. The rest of the proof then goes as before.
Differentiating the above function yields (1/x^2)(1-log(x))x^(1/x), which is positive when log(x) < 1 and negative when log(x) > 1. So the function has a maximum at e and decreases on either side of it. Therefore one of our integers must be less than e, and the other greater than it. For the smaller integer there are only two possibilities, 1 and 2. Using 1 doesn't give a solution since the equation x^(1/x) = 1 only has the solution 1. So the only remaining possibility for the smaller number is 2, which does yield the solution 2^4 = 4^2. Since x^(1/x) is strictly decreasing when x > e, there can't be any other solutions with the same value.
Logs will appear no matter what, at some point in the line of reasoning. They are only held back until differentiating in this approach. I think the expression for the derivative of logn/n was much nicer to grapple with.
Seeing as we're in the integer world, I'm not sure logs need to show up ever, there's probably a proof path around unique prime factorisations. E.g. it's more or less immediately obvious that n and m would need to share the same prime factors in the same ratios.
It is a sort of automatic reflex when encountering stuff like $x^x$ in such contexts like here in mathematics to take logarithms. Working with logarithms is usually much simpler and easier to understand when having variables in both the exponent and the base, both for technical reasons (the logarithms will not be avoided anyway, as the other commenter said) and for intuition-gaining reasons. Multiplication of two functions is more intuitively understood (as one can work stuff such as signs, monotonicity etc easily) than exponentiation involving one function in the base and one in the exponent.
Plus this approach (IMO) visualised better than the proposed alternative.
I think it's arguable that OP's approach is cleaner for some value of clean, but the article's approach gave me happy flashbacks to doing number theory in undergrad that OP's approach didn't.
When communicating to the wider world, aesthetics do matter, and yeah, everything you said as well.
Since m and n are distinct, we may assume that m > n >= 2. From the equation and unique factorization, we know that n divides m, so write m = nd.
Then (nd)^n = n^(nd).
Hence d^n = n^{n(d-1)}, which yields d = n^{d-1} >= 2^{d-1}.
Claim: if k is an integer greater than or equal to 3, then k < 2^{k - 1}.
Proof: the base case is clear: 3 < 4. Suppose k > 3 and k - 1 < 2^{k - 2}.
Then k < 2^{k-2} + 1 <= 2^{k-1}, where the last inequality holds because 2^{k-1} - 2^{k-2} = 2^{k-2} >= 1. QED
So, d must be less than 3. Since m = nd and m and n are distinct, d is not 1, so d = 2.
Since d = n^{d-1} and d - 1 = 1, we have n = d, so m = 4.
How exactly do we know that n divides m? I think it's clear that they have the same prime factors, but it's not clear why they couldn't be like n = 12 and m = 18.
Say m contains the prime factor p^i and n contains the prime factor p^j, then m^n will contain p^in and n^m will contain p^jm. For them to be equal we need in = jm or i/j = m/n but for a given solution m/n is constant and the prime factor multiplicity ratio must be equal to that. And that applies to all prime factors, their multiplicities must all have the same constant ratio, therefore the smaller of the two numbers must have smaller multiplicity for all prime factors and therefore divide the larger number. There is probably a simpler way to say this, this feels too complicated.
I think it's even simpler after you figured out that m = kn = n^k => n is an integer > 1 and equal to the (k-1)-th root of k where k is an integer > 1.
The only integer (k-1)-th root of k is 2 for k = 2. Thus, n = 2, k = 2, m = 4.
No, it's a carefully constructed logical argument. Miles ahead of anything GPT is capable of producing, based on my experiments with it.
There's a clear signal that it's constructed by a person with advanced mathematical training: the laconic, "high points only" style. It makes small, but nontrivial and correct, logical leaps, expecting that you will work through the details needed to justify the leap yourself.
What drove you to this conclusion? We have an enlightening reply explaining how we know it isn't, but I would also like to know what heuristic you used (so that we know to be wary of it!)
I am not a mathematician, but in the discrete domain of integers:
1) you have two functions, essentially we look for where the two 3d space surfaces intersect, if z is taken as the result for each equation.
2) the integers "are disctinct", so (0,0) and (1,1) are out, plus (2,2) (3,3) etc. Basically a whole linear diagonal in the instersection of both 3d spaces is excluded (why though, to what useful end?)
3) Starting points for the ranges is therefore (0,1) and (1,0)
4) 1^y is always 1, and x^0 is always 1 so there is a constant starting value of 1 both on both axis
5) but x^y will always be larger than y^x, for y>x and x^y > y^x
(prove this by taking the first derivative to get rate of change. Do you use Laplace z domain for discrete, instead of s for continuous?)
6) and the converse to 5.
So once you have found one solution, you know to stop looking, the two surfaces keep diverging from each other.
Why resort to the continuous domain to solve a problem n the discrete, is this even a valid approach?
eg Is there a formal proof that says integers strictly follow that same rules as the continuous domain, just as a subset? I'm interested.
Does this come under group theory, a set with an applied operation?
As I said I am not a mathematician, I am an electrical engineer so probably one of the worst abusers of pure math in a formal sense, but the more I think about this the more questions this raises in my thinking.
> 5) but x^y will always be larger than y^x, for y>x and x^y > y^x (prove this by taking the first derivative to get rate of change. Do you use Laplace z domain for discrete, instead of s for continuous?)
This is false, though! Or, it's almost always true, but there are some exceptions. We of course have an exception at (2,4) and (4,2), where they're equal, and of course at (n,n), where they're obviously equal. And of course 0's and 1's will cause problems for you.
But also, most interestingly, there's an exception at (2,3) and (3,2)! 2<3, and yet, 3^2 > 2^3. Any proof has to account for this!
(There's a fair bit I could say about this exception, but perhaps I should just let you think about it instead. :) )
> Why resort to the continuous domain to solve a problem n the discrete
Because oftentimes this is easier. (In a number of cases it's much easier.) Also... you did this? Like to the extent that your step (5) is valid, you seem to have "proven" it by using the first derivative. That's a continuous tool! I'm not sure what you're talking about with the "Laplace z domain". Or are you using "first derivative" to mean "first difference", or something?
> is this even a valid approach?
Yes, why wouldn't it be? In fact this is actually one of the big reasons for introducing larger number systems, that they let you prove things about the original smaller number system. The rational numbers let you prove things about the integers; the complex numbers let you prove things about the reals; the real numbers and p-padic numbers let you prove things about the rationals; etc. (The integers let you prove things about the whole numbers!)
Proving statements about integers by means of complex numbers is a whole field in itself, i.e., analytic number theory. And in the case of Goodstein's theorem, one famously proves a statement about the whole numbers by passing to the ordinals...
Apropos: difference calculus is a fascinating topic. It has lots of results that are analogous to differential calculus.
Yes, p-adic numbers are also really interesting to look into.
It's also interesting to re-derive much of analysis (like limits and derivatives etc) in the context of the dual numbers (https://en.wikipedia.org/wiki/Dual_number):
> They are expressions of the form a + b * ε, where a and b are real numbers, and ε is a symbol taken to satisfy ε^2 = 0 with ε ≠ 0.
You can sort-of pretend that ε is an infinitesimal, but with a sound theoretical footing.
"The Z-transform is a mathematical tool which is used to convert the difference equations in discrete time domain into the algebraic equations in z-domain."
I was taught in engineering math that z-domain is the Laplacian discrete equivelent of the s domain, which is continuous and used by EE as well in analog.
z^-1 (or z(-1) means last sample. It is commonly used in digital signal processing, FFT etc.
s domain is used for (from memory) the operater e^-jw, which is for electrical engineers the transform for use with sine waves, such that impedance is 1/sC for capacitance and sL for inductance.
z domain has useful properties like "The differentiation in z-domain property of Z-transform states that the multiplication by n in time domain corresponds to the differentiation in zdomain."
I am sure I have made some technical mistakes in the above, but it is how I remember it and they don't impact my ability to apply it for my limited EE needs.
As to the question about the valid approach, intuitively I see this, but wondering if there was a formal proof of some kind, or is it taken as given?
A subset won’t have more solutions than its containing set; but it may have fewer.
Many problems are easier to solve in the reals (due to being complete), and you can then restrict that solution to your (sub)set of interest — in this case, the integers.
You see the same thing with Pythagorean triples being simpler to solve by doing the math over the complex numbers and then restricting your answers.
I'm trying to understand 5). If you're claiming that both (A) y > x, and (B) x^y > y^x hold, then x^y > y^x ("will always be larger") holds. You're satisfying your claim by assumption. Nothing new is deduced.
However, if only A) needs to be satisfied: y = 3, x = 2 is a counterexample, as x^y = 2^3 = 8 < 9 = 3^2 = y^x.
edit: looks like someone had the same thought as me as I was typing my reply!
I am not a mathematician either, I always maintained the university made a mistake granting make a math teacher degree :) It was also long ago enough a lot of you weren't even alive and I haven't done any such work in a quarter century. Nonetheless...
> but x^y will always be larger than y^x, for y>x and x^y > y^x (prove this by taking the first derivative to get rate of change. Do you use Laplace z domain for discrete, instead of s for continuous?)
I am struggling to follow what are you saying here
>
Why resort to the continuous domain to solve a problem n the discrete, is this even a valid approach?
I can't make heads or tails of this question. The proof says, correctly, for all (real) x != y, x < y solutions it is true that 0<x<e and e<y. He found this by investigating the derivative and establishing the monotonically increasing / decreasing nature of the function. Only after finding this out using does he go back to the original question: what integer x could be? Since he restricted x to be 0 < x < e , we only need to investigate the case of 1 and 2.
Yes, m=n is a solution, or set of solutions, but why arbitrarily exclude some solutions and not others?
There is no explanation as to why - eg maybe it could be if the equations represent a physical system and m=n implied the same physical space was occupied by two objects, for want of a better example.
But if the equations represented some kind of abstract concept, why are not all solutions valid and of interest?
It seems like me saying, find an equation that only yields all the primes that use any digit once - but why, to what end and value?
For today’s interesting problem, we are looking to find all positive integer pairs n and m which satisfy the equation above, when n and m are distinct. If we play around with small n and m we can quickly see that 2⁴ = 16 = 4² , so the pair 2 and 4 are certainly one solution. Actually, it is the only solution.
I noticed this interesting fact during my secondary school education. Additionally you can use this to prove that e is the point where a change in the exponent causes a larger result than a change in the base. E.g. (x+d)^y > x^(y+d) when y >= e for any real value d.
Alternative proof without any real numbers, logs or the like:
After relabeling we may assume n<m.
Step 1: We claim that there exists a natural number k such that m=kn.
Write the equation as
n^n n^(m-n) = m^n
n^(m-n) = (m/n)^n
The left-hand-side is always an integer. The right-hand-side is an integer if and only if such a factor k exists.
Step 2: Inserting this ansatz, we may take n-th roots and reduce the problem to n^k =k n.
Step 3: Monotonicity. Clearly we have equality for k=1.
We claim that the difference n^k-kn strictly increases with k for fixed n unless n=2, k=1. That claim in particular gives the result.
We prove this by induction in k. That is, suppose that n^k\geq kn holds for all k\leq K, then
n^(K+1) = n n^K \geq n K n \geq Kn +Kn \geq Kn +n = (K+1)n.
The second inequality is strict unless n=2 and the last one is strict unless K=1.
(m/n)^n is only an integer if m/n is an integer: true but this is quite a big piece of mathematics on its own.
The proof that no rational number squares to 2 is a famous result of number theory. That no rational non-integer, raised to any power, is any integer, surely has to be justified here.
True, but considering that the linked post uses e, log, limits and derivatives without any further comment, I am going to err on the side of "nah, enough detail".
I was interested in the proof of this ("if x is a rational number, and x raised to the power of an integer is an integer, then x is an integer"), so I asked the new Bing. It actually gave a correct proof (despite no relevant links found in Google)!
------BELOW IS BING'S OUTPUT
This statement is true. If x is a rational number and x raised to the power of an integer is an integer, then x is an integer. This statement is called the rational root theorem. The proof of this theorem is based on the fact that if x is not an integer, then it can be expressed as a fraction p/q where p and q are integers and q ≠ 0. Then, x raised to the power of an integer can be expressed as (p/q)^n which can be simplified to p^n/q^n. Since p^n and q^n are integers, p^n/q^n is a rational number. If x raised to the power of an integer is an integer, then q^n must divide p^n. Since p and q are relatively prime, this implies that q = 1. Therefore, x is an integer.
Nah, k=1 is the trivial base case and is allowed. The "assumption" is no such thing, but just notational convenience. One can of course tidy that up (e.g. n\leq m and trivial case is obvious), but for a random HN post it seems not worth the effort.
Showing the graph of the functions without showing that there are only two possible integers to work with (since we're looking for solutions in ℕ, not ℝ) on the left side of the maximum feels like missing the most important part of the drawing things out. You can even leave the y axis unlabeled, but label the x-axis (especially since we've already determined f(1)=0) and draw some dots on the curve to show that those are the only values that can be in our solution space.
"There's a maximum at e, so the only two possible values on the left of e that can be used in these pairs are 1, and 2. But really there's only one, because 1 is the power identity, so we can't use that. If there is a solution, it has to use 2."
Which means we're solving one function for one unknown, in the natural numbers. 2ⁿ=n² gives n=4. We have found the only pair of integers that satisfies our constraint function.
Differentiating the above function yields (1/x^2)(1-log(x))x^(1/x), which is positive when log(x) < 1 and negative when log(x) > 1. So the function has a maximum at e and decreases on either side of it. Therefore one of our integers must be less than e, and the other greater than it. For the smaller integer there are only two possibilities, 1 and 2. Using 1 doesn't give a solution since the equation x^(1/x) = 1 only has the solution 1. So the only remaining possibility for the smaller number is 2, which does yield the solution 2^4 = 4^2. Since x^(1/x) is strictly decreasing when x > e, there can't be any other solutions with the same value.
I think it's arguable that OP's approach is cleaner for some value of clean, but the article's approach gave me happy flashbacks to doing number theory in undergrad that OP's approach didn't.
When communicating to the wider world, aesthetics do matter, and yeah, everything you said as well.
Since m and n are distinct, we may assume that m > n >= 2. From the equation and unique factorization, we know that n divides m, so write m = nd.
Then (nd)^n = n^(nd). Hence d^n = n^{n(d-1)}, which yields d = n^{d-1} >= 2^{d-1}.
Claim: if k is an integer greater than or equal to 3, then k < 2^{k - 1}.
Proof: the base case is clear: 3 < 4. Suppose k > 3 and k - 1 < 2^{k - 2}. Then k < 2^{k-2} + 1 <= 2^{k-1}, where the last inequality holds because 2^{k-1} - 2^{k-2} = 2^{k-2} >= 1. QED
So, d must be less than 3. Since m = nd and m and n are distinct, d is not 1, so d = 2. Since d = n^{d-1} and d - 1 = 1, we have n = d, so m = 4.
The only integer (k-1)-th root of k is 2 for k = 2. Thus, n = 2, k = 2, m = 4.
There's a clear signal that it's constructed by a person with advanced mathematical training: the laconic, "high points only" style. It makes small, but nontrivial and correct, logical leaps, expecting that you will work through the details needed to justify the leap yourself.
For example, the reasoning in this sibling comment is needed to justify the "n divides m" claim https://news.ycombinator.com/item?id=35638344
In my experience, GPT writes much more verbose arguments and cannot reliably reason at this level.
I am not a mathematician, but in the discrete domain of integers:
1) you have two functions, essentially we look for where the two 3d space surfaces intersect, if z is taken as the result for each equation.
2) the integers "are disctinct", so (0,0) and (1,1) are out, plus (2,2) (3,3) etc. Basically a whole linear diagonal in the instersection of both 3d spaces is excluded (why though, to what useful end?)
3) Starting points for the ranges is therefore (0,1) and (1,0)
4) 1^y is always 1, and x^0 is always 1 so there is a constant starting value of 1 both on both axis
5) but x^y will always be larger than y^x, for y>x and x^y > y^x (prove this by taking the first derivative to get rate of change. Do you use Laplace z domain for discrete, instead of s for continuous?)
6) and the converse to 5.
So once you have found one solution, you know to stop looking, the two surfaces keep diverging from each other.
Why resort to the continuous domain to solve a problem n the discrete, is this even a valid approach?
eg Is there a formal proof that says integers strictly follow that same rules as the continuous domain, just as a subset? I'm interested.
Does this come under group theory, a set with an applied operation?
As I said I am not a mathematician, I am an electrical engineer so probably one of the worst abusers of pure math in a formal sense, but the more I think about this the more questions this raises in my thinking.
Can someone point out errors in thinking?
This is false, though! Or, it's almost always true, but there are some exceptions. We of course have an exception at (2,4) and (4,2), where they're equal, and of course at (n,n), where they're obviously equal. And of course 0's and 1's will cause problems for you.
But also, most interestingly, there's an exception at (2,3) and (3,2)! 2<3, and yet, 3^2 > 2^3. Any proof has to account for this!
(There's a fair bit I could say about this exception, but perhaps I should just let you think about it instead. :) )
> Why resort to the continuous domain to solve a problem n the discrete
Because oftentimes this is easier. (In a number of cases it's much easier.) Also... you did this? Like to the extent that your step (5) is valid, you seem to have "proven" it by using the first derivative. That's a continuous tool! I'm not sure what you're talking about with the "Laplace z domain". Or are you using "first derivative" to mean "first difference", or something?
> is this even a valid approach?
Yes, why wouldn't it be? In fact this is actually one of the big reasons for introducing larger number systems, that they let you prove things about the original smaller number system. The rational numbers let you prove things about the integers; the complex numbers let you prove things about the reals; the real numbers and p-padic numbers let you prove things about the rationals; etc. (The integers let you prove things about the whole numbers!)
Proving statements about integers by means of complex numbers is a whole field in itself, i.e., analytic number theory. And in the case of Goodstein's theorem, one famously proves a statement about the whole numbers by passing to the ordinals...
Yes, p-adic numbers are also really interesting to look into.
It's also interesting to re-derive much of analysis (like limits and derivatives etc) in the context of the dual numbers (https://en.wikipedia.org/wiki/Dual_number):
> They are expressions of the form a + b * ε, where a and b are real numbers, and ε is a symbol taken to satisfy ε^2 = 0 with ε ≠ 0.
You can sort-of pretend that ε is an infinitesimal, but with a sound theoretical footing.
See https://math.stackexchange.com/questions/341535/is-the-theor...
from
https://www.tutorialspoint.com/differentiation-in-z-domain-p....
I was taught in engineering math that z-domain is the Laplacian discrete equivelent of the s domain, which is continuous and used by EE as well in analog.
z^-1 (or z(-1) means last sample. It is commonly used in digital signal processing, FFT etc.
s domain is used for (from memory) the operater e^-jw, which is for electrical engineers the transform for use with sine waves, such that impedance is 1/sC for capacitance and sL for inductance.
z domain has useful properties like "The differentiation in z-domain property of Z-transform states that the multiplication by n in time domain corresponds to the differentiation in zdomain."
I am sure I have made some technical mistakes in the above, but it is how I remember it and they don't impact my ability to apply it for my limited EE needs.
As to the question about the valid approach, intuitively I see this, but wondering if there was a formal proof of some kind, or is it taken as given?
Many problems are easier to solve in the reals (due to being complete), and you can then restrict that solution to your (sub)set of interest — in this case, the integers.
You see the same thing with Pythagorean triples being simpler to solve by doing the math over the complex numbers and then restricting your answers.
However, if only A) needs to be satisfied: y = 3, x = 2 is a counterexample, as x^y = 2^3 = 8 < 9 = 3^2 = y^x.
edit: looks like someone had the same thought as me as I was typing my reply!
It's hilarious that the FIRST two integers greater than one form a counter example to their "proof".
> but x^y will always be larger than y^x, for y>x and x^y > y^x (prove this by taking the first derivative to get rate of change. Do you use Laplace z domain for discrete, instead of s for continuous?)
I am struggling to follow what are you saying here
> Why resort to the continuous domain to solve a problem n the discrete, is this even a valid approach?
I can't make heads or tails of this question. The proof says, correctly, for all (real) x != y, x < y solutions it is true that 0<x<e and e<y. He found this by investigating the derivative and establishing the monotonically increasing / decreasing nature of the function. Only after finding this out using does he go back to the original question: what integer x could be? Since he restricted x to be 0 < x < e , we only need to investigate the case of 1 and 2.
That’s trivially true, as that last condition equals the claim:
Also, if you leave out the and x^y > y^x part, that isn’t generally true because, for example 2⁴ = 4² and 1² < 2¹.Another, minor, point: you write
> Why resort to the continuous domain to solve a problem n the discrete
and
> essentially we look for where the two 3d space surfaces intersect
Those two are in conflict with each other.
Because if m=n, then n^m=m^n is trivially true.
There is no explanation as to why - eg maybe it could be if the equations represent a physical system and m=n implied the same physical space was occupied by two objects, for want of a better example.
But if the equations represented some kind of abstract concept, why are not all solutions valid and of interest?
It seems like me saying, find an equation that only yields all the primes that use any digit once - but why, to what end and value?
It may have come as a surprise to a programmer, but in the domain of math, the integers are indeed a subset of a real numbers.
Deleted Comment
No one said there was one.
OP said "interesting problem".
Deleted Comment
2^1 = 2
Deleted Comment
After relabeling we may assume n<m.
Step 1: We claim that there exists a natural number k such that m=kn.
Write the equation as
n^n n^(m-n) = m^n
n^(m-n) = (m/n)^n
The left-hand-side is always an integer. The right-hand-side is an integer if and only if such a factor k exists.
Step 2: Inserting this ansatz, we may take n-th roots and reduce the problem to n^k =k n.
Step 3: Monotonicity. Clearly we have equality for k=1. We claim that the difference n^k-kn strictly increases with k for fixed n unless n=2, k=1. That claim in particular gives the result.
We prove this by induction in k. That is, suppose that n^k\geq kn holds for all k\leq K, then
n^(K+1) = n n^K \geq n K n \geq Kn +Kn \geq Kn +n = (K+1)n.
The second inequality is strict unless n=2 and the last one is strict unless K=1.
The proof that no rational number squares to 2 is a famous result of number theory. That no rational non-integer, raised to any power, is any integer, surely has to be justified here.
True, but considering that the linked post uses e, log, limits and derivatives without any further comment, I am going to err on the side of "nah, enough detail".
------BELOW IS BING'S OUTPUT
This statement is true. If x is a rational number and x raised to the power of an integer is an integer, then x is an integer. This statement is called the rational root theorem. The proof of this theorem is based on the fact that if x is not an integer, then it can be expressed as a fraction p/q where p and q are integers and q ≠ 0. Then, x raised to the power of an integer can be expressed as (p/q)^n which can be simplified to p^n/q^n. Since p^n and q^n are integers, p^n/q^n is a rational number. If x raised to the power of an integer is an integer, then q^n must divide p^n. Since p and q are relatively prime, this implies that q = 1. Therefore, x is an integer.
But k cannot be equal to 1 as per your assumption that n<m. So you need to still prove a base case for the induction step.
"There's a maximum at e, so the only two possible values on the left of e that can be used in these pairs are 1, and 2. But really there's only one, because 1 is the power identity, so we can't use that. If there is a solution, it has to use 2."
Which means we're solving one function for one unknown, in the natural numbers. 2ⁿ=n² gives n=4. We have found the only pair of integers that satisfies our constraint function.