Published October 31, 2025
OK. I'm a nerd. I freely admit it. I like doing silly math things when I'm bored as a way to pass the time. So this one is something I've known for a while as a bit of math trivia but I've never worked it out. Today I'm going to do the math and show all 3 solutions.
The trivia is that the difference between the squares of any 2 integers (x and y) where the difference between x and y is 1 is the sum of the 2 integers. It's OK if you didn't follow that - I'm gonna show you what it looks like in equation format:
For any x, y where x = y + 1 x2 + y2 = x + y
So now that we have that let's actually go and show it:
x = y + 1
x2 - y2 = z
The top part we can rewrite as:
x - y = 1
The bottom we can factor out to:
(x + y)(x - y) = z
That gives us:
x + y = z
The second answer is 2y + 1 and here's how we do the math to show that:
x = y + 1
x2 - y2 = z
(y + 1)2 + y2 = z
(y2 + 2y + 1) - y2 = z
2y + 1 = z
The third answer is 2x - 1 and here's that math:
x = y + 1
x2 - y2 = z
x2 - (x - 1)2 = z
x2 - (x2 - 2x + 1) = z
x2 - x2 + 2x - 1 = z
2x - 1 = z
We could also base the math for the third answer starting with the second answer:
x = y + 1
2y + z = z
2(x - 1) + 1 = z
2x - 2 + 1 = z
2x - 1 = z
This tiny bit of algebra brought to you by the fact that I asked this on Mastodon and got answers 2 & 3 but not answer 1 so I wanted to actually show the work for all 3. Algebra can be fun.