This question is inspired by my answer to this one: Surprising identities / equations
In that question, people were asked about the most surprising result that they knew. Almost all of them quoted someone else's result.
I was one of the only ones to reply about a result of mine that greatly surprised me.
So, I have decided to make that a question on its own:
What is your own mathematical result that surprised you the most?
Here is mine.
Consider the diophantine equation $$x(x+1)...(x+n-1) -y^n = k$$
where $x, y, n,$ and $k$ are integers, $x \ge 1$, $y \ge 1$, and $n \ge 3$.
I was led to consider considering this by trying to generalize the Erdos-Selfridge result that the product of consecutive integers could never be a power.
I phrased this as "How close and how often can the product of $n$ consecutive integers be to an $n$-th power?"
Looking at this equation, it seemed reasonable to think that, for fixed $k$ and $n$, there were only a finite number of $x$ and $y$ that satisfied it. This was not too hard to prove.
What greatly surprised me was that I was able to prove that for any fixed $k$, there were only a finite number of $n$, $x$, and $y$ that satisfied it.
The proof went like this:
I first showed that any solution must have $y \le |k|$. This was moderately straightforward, and involved considering the three cases $y < x$, $x \le y \le x+n-1$, and $y \ge x+n$.
Note: The proof that $y \le |k|$ has been added at the end.
The next step really surprised me. I showed that $n < e|k|$, where $e$ is the good old base of natural logarithms.
The proof was amazingly (to me) simple. Since $y \le |k|$ and $2(n/e)^n < n!$,
$\begin{align} 2(n/e)^n &< n!\\ &\le x(x+1)...(x+n-1)\\ &= y^n+k\\ &\le |k|^n+|k|\\ &\le |k|^n+|k|^n\\ &= 2|k|^n\\ \end{align} $
so $n < e |k|$.
I still remember staring at this in disbelief, over forty years later.
I was asked to show my proof that $y \le |k|$.
For brevity, I will write $x(x+1)...(x+n-1)$ as $x!n$, because this is a generalization of factorial.
The basic inequality is $$(x^2+(n-1)x)^{n/2} \le x!n \le (x+(n-1)/2)^n$$
I also use two lemmas:
(L1) If $0 < a < b$ and $n > 1$ then $n(b-a)a^{n-1} < b^n-a^n < n(b-a)b^{n-1}$.
(L2) If $a^m \leq b^m+c$ where $a \geq 0$, $b >0$, $c \geq 0$, and $m \geq 1$, then $a \leq b + c/(m\,b^{m-1})$.
The basic idea is simple: either $x < y < x+n-1$ or $y$ is outside this range. If $y$ is inside the range, then $y$ divides both $x!n$ and $y^n$, so $y$ divides their difference, which is $k$. If $y$ is outside the range, then we can use the basic inequality and the lemmas to derive very strong inequalities on $x$ and $y$.
Here are all the cases.
If $k=0$, so $x!n = y^n$, then $x < y < x+n-1$, or $x+1 < y+1 \leq x+n-1$, so that $y+1 | x!n$ or $y+1 | y^n$, which is impossible.
If $k > 0$, $x!n > y^n$, so that, $y < x+(n-1)/2$.
If $ y > x$, then, as stated above, $y | k$.
If $y \leq x$, then $(x^2 + (n-1)x)^{n/2} \le x!n = y^n + k \le x^n + k $ or, by L2, $x^2 + (n-1)x \le x^2 + 2k/\left(n\,x^{n-2}\right) $ so that $ x^{n-1} \leq 2k/n(n-1). $
Therefore $y \le x \le \left(\frac{2k}{n(n-1)}\right)^{1/(n-1)}$.
If $k < 0$, $x!n < y^n$, so that, $y^2 > x^2+(n-1)x$, which implies that $y > x$.
If $ y < x+n-1$, then, as stated above, $y | |k|$.
If $y \geq x+n-1$, then
$(x+n-1)^n \leq y^n = x!n - k = x!n + |k| \leq (x+(n-1)/2)^n + |k| $ or, by L2, $x+n-1 \leq x+(n-1)/2 + \frac{|k|}{ n(x+(n-1)/2)^{n-1} }$ or $(n-1)/2 \leq \frac{|k|} { n(x+(n-1)/2)^{n-1}} $ so that $\left(x+(n-1)/2\right)^{n-1} \leq \frac{2|k|}{n(n-1)}. $
Since $y^n \leq (x + (n-1)/2))^n + |k| \leq \left(\frac{2|k|}{n(n-1)}\right)^{n/(n-1)} + |k| \leq |k|^{n/(n-1)} + |k|, $ $ y \leq |k|^{1/(n-1)} + 1/n.$
In all the cases, $y \le |k|$. When $y < x$ or $y \ge x+n-1$, $y$ is significantly smaller.


