Difference of Squares and Pythagorean Triples

A spot for all things TestTube
exfret
Posts: 585
Joined: Sun Jul 28, 2013 8:40 pm

Difference of Squares and Pythagorean Triples

Post by exfret »

Choose any odd number. Square it and divide by two. Now get two numbers, one by rounding up and the other by rounding down. What you get is a Pythagorean Triple. I want to see if anyone can figure out why this happens. I figured this out independently when I was thinking about difference of squares. I thought it was really cool, especially since it was something I found out myself without even trying to discover anything (lots of times I will try to think of why something someone is telling me is true, so I'll want to figure that out). The way I did it involves difference of squares. I'll start you out with a question: In your head, what's 96*104?


[A spoiler showing you how I figured out my pythagorean triple thing would be useful here. Any way you think you can allow spoilers in these fora Andy?]

Hint #1:
SPOILER
SPOILER_SHOW
Well what is 96*104? Answer: 96=100-4, 104=100+4, so 96*104=(100-4)(100+4). Then, DOS (Difference of Squares), 100^2-4^2, which is 10000-16, which is 99984. Cool, right?
Hint #2:
SPOILER
SPOILER_SHOW
You can do that (hint #1) with any 2 numbers equidistant from one hundred. Also, when they're equidistant from a number, n it would just be (n+d)(n-d), where d is the distance each number is from n. In fact, for any two numbers, a and b, there is one number that lies between them, which you can find through (a+b)/2, so you can use this for any product.
Hint #3:
SPOILER
SPOILER_SHOW
If a is any natural number, what's a*1?
Hint #4:
SPOILER
SPOILER_SHOW
When is the number between a and 1 whole? That would be when it's odd. Try change a*1 to a difference of squares multiplication for a few odd numbers: 1*1=?, 3*1=?, 5*1=?, 7*1=? For example, the number between 1 and 1 is 1, and the difference between those two numbers is zero, so you'd get (1-0)(1+0).
Hint #5:
SPOILER
SPOILER_SHOW
For 1*a for the first few odd natural numbers a you'd get 1*1=(1+0), 1*3=(2-1)(2+1), 1*5=(3-2)(3+2), 1*7=(4-3)(4+3). The pattern here, obviously, is that the middle number between 1 and a goes by 1 when a goes up by two. This is because a's weight on the middle number is 1/2, so an increase of two would have 50% weight, making it an increase of 1 on the middle number. Since the middle number goes up one and 1 stays constant, the difference between 1 and that number goes up one each time a increases by two.
Hint #6:
SPOILER
SPOILER_SHOW
So, how could we write 1*a in terms of a using difference of squares where a is an odd natural number?
Hint #7:
SPOILER
SPOILER_SHOW
Well, since the middle number between the odd natural number a and 1 is (1+a)/2, which is 1/2+a/2, and the difference is always one less than the middle number, which is a/2+1/2-1, which is itself a/2-1/2, 1*a=[(a/2+1/2)-(a/2-1/2)]*[(a/2+1/2)+(a/2-1/2)]
Hint #8:
SPOILER
SPOILER_SHOW
Don't simplify according to your instincts. Remember DOS!
Hint #9:
SPOILER
SPOILER_SHOW
=(a/2+1/2)^2-(a/2-1/2)^2, and since an odd number divided by two plus a half is a whole number, and the same goes for subtracting a half, both of these are whole number when a is an odd whole number.
Hint #10:
SPOILER
SPOILER_SHOW
What happens if a is a perfect square?
Final hint:
SPOILER
SPOILER_SHOW
if a is a perfect square, you get sqrt(a)^2=(a/2+1/2)^2-(a/2-1/2)^2. And since, through the definition of perfect square, sqrt(a) is a perfect square, and because the other terms on the other side are whole numbers (we proved this earlier), we can, with any odd number x, square x to get an a that satisfies the pythagorean theorem using only whole numbers. If you want this all to look more pythagor-y to you, you can do this: sqrt(a)^2+(a/2-1/2)^2=(a/2+1/2)^2. QuantumElectricDynamics. :P
Since I'm out of time, I couldn't create a final answer spoiler all-in-one, but you can just go through the hints.
Last edited by exfret on Thu Feb 20, 2014 7:05 pm, edited 1 time in total.
Nobody ever notices my signature. ):
User avatar
robly18
Posts: 413
Joined: Tue Jun 04, 2013 2:03 pm

Re: Difference of Squares and Pythagorean Triples

Post by robly18 »

Let's see the Pythagorean triplet thing...

Let's say, 7.
7^2 = 49
49/2 = 24.5
The numbers you get are 24 and 25.
I don't see any Pythagorean triplet here.

This would only apply to 1 and 3.
Convincing people that 0.9999... = 1 since 2012
User avatar
testtubegames
Site Admin
Posts: 1148
Joined: Mon Nov 19, 2012 7:54 pm

Re: Difference of Squares and Pythagorean Triples

Post by testtubegames »

robly18 wrote:Let's say, 7.
...
The numbers you get are 24 and 25.
I don't see any Pythagorean triplet here.
Yup, that's a triplet.

That's a nice little trick, exfret. It's a good little exercise to write it out and prove it.
SPOILER
SPOILER_SHOW
Also, we now have spoilers
User avatar
robly18
Posts: 413
Joined: Tue Jun 04, 2013 2:03 pm

Re: Difference of Squares and Pythagorean Triples

Post by robly18 »

Oh, okay. I assumed none of them was the hypotenuse.
Well then, here's my attempt at a proof:

If (2x+1)^2 / 2 + 0.5 and (2x+1)^2 / 2 - 0.5 ends up as a triplet for any integer x:

2x^2 + 2x + 0.5 + 0.5 and 2x^2 + 2x + 0.5 - 0.5 does as well

Thus, this applies to the following:

2x^2 + 2x + 1 and 2x^2 + 2x

So, for any integer x, 2x^2 + 2x + 1 and 2x^2 + 2x should form a triplet.

As such, for any integer k, one of the following should apply true:

(2x^2 + 2x + 1)^2 + (2x^2 + 2x)^2 = k^2
(2x^2 + 2x + 1)^2 + k^2 = (2x^2 + 2x)^2
k^2 + (2x^2 + 2x)^2 = (2x^2 + 2x + 1)^2

We can discard the latter, because such would imply k to be complex. Thus, we're left with:

(2x^2 + 2x + 1)^2 + (2x^2 + 2x)^2 = k^2
(2x^2 + 2x + 1)^2 + k^2 = (2x^2 + 2x)^2

Let's simplify the former:

(a+b+c)^2 = a(a+b+c) + b(a+b+c) + c(a+b+c) = a^2 + 2ab + 2ac + 2bc + b^2 + c^2

4x^4 + 8x^3 + 4x^2 + 4x + 4x + 1 + 4x^4 + 8x^3 + 4x^2 = k^2
8x^4 + 16x^3 + 4x^2 + 8x + 1 = k^2

That's quite the polynomial though... Now all that's left to do is prove that for integer x there must be an integer k and vice versa. However, I fear that might be beyond my knowledge.
As for the other one. I've had enough brainwork for now :p
Convincing people that 0.9999... = 1 since 2012
A Random Player
Posts: 523
Joined: Mon Jun 03, 2013 4:54 pm

Re: Difference of Squares and Pythagorean Triples

Post by A Random Player »

SPOILER
SPOILER_SHOW
n=odd number (given)
a=n^2/2-.5 (given)
b=n^2/2+.5 (given)
n^2+a^2=b^2 (Pythagorean theorem)
4n^2+4a^2=4b^2 (multiply both sides by 4)
4n^2+4(n^2/2-.5)^2=4(n^2/2+.5)^2 (substitute in a and b, what's left is all in terms of n)
4n^2+4(n^4/4-n^2/2+.25)=4(n^4/4+n^2/2+.25) (expand polynomials (binomial theorem))
4n^2+n^4-2n^2+1=4n^4+2n^2+1 (distributive property)
4n^2-2n^2+1=2n^2+1 (subtract 4n^4 from both sides)
4n^2-2n^2=2n^2 (subtract 1 from both sides)
4n^2=4n^2 (add 2n^2 to both sides)
QED.
Editting in a bit to add explanation... Done
Last edited by A Random Player on Thu Feb 20, 2014 6:10 pm, edited 1 time in total.
$1 = 100¢ = (10¢)^2 = ($0.10)^2 = $0.01 = 1¢ [1]
Always check your units or you will have no money!
User avatar
robly18
Posts: 413
Joined: Tue Jun 04, 2013 2:03 pm

Re: Difference of Squares and Pythagorean Triples

Post by robly18 »

Well that's uh... More elegant than mine.

I'll be crying in a corner at my lack of mathematical skill now, hoping I can ever be like you.

EDIT:I realize my mistake now. I overcomplicated it and didn't think that it would be... I just kinda misunderstood it.
Well then.
Convincing people that 0.9999... = 1 since 2012
exfret
Posts: 585
Joined: Sun Jul 28, 2013 8:40 pm

Re: Difference of Squares and Pythagorean Triples

Post by exfret »

everyone wrote:Everything
2x+1 is a part of the triple, though, so k=2x+1. Sorry for my vague language (it wasn't just your misinterpretation), but I meant that the odd number would be a member of the triplet as well. Also robly, remember that you were the one that came up with the equation idea in the first place, you just made an over-complication that ARP saw and fixed. Also, here's a hint which'll tell you which one's hypotenuse (which you probably won't need anymore with ARP's post):
SPOILER
SPOILER_SHOW
(0.5*x^2+1/2)^2-(0.5*x^2-1/2)^2=(x^2)
Since I didn't do it your way, I'm going to attempt it in the next spoiler:
SPOILER
SPOILER_SHOW
So, just to make it all easier, I'm going to use k in which k=x^2
(0.5*k+1/2)^2-(0.5*k-1/2)^2=k
(k^2)/4+k/2+1/4-(k^2)/4+k/2-1/4=k
Since (0.5*k+1/2)^2 is exactly the same as (0.5*k-1/2)^2 except for the difference of a k, then it all cancels out, except that one little k, leaving this:
[(k^2)/4-(k^2)/4]+[1/4-1/4]+[k/2+k/2]=k
0+0+(k/2+k/2)=k
k/2+k/2=k
k=k
And it's verified! Now we just know that we can have any odd number, x, give us a value k that is x^2, and since x^2 is odd, dividing it by 2 will get you something + half, and adding a half or subtracting a half both make that number whole, and squaring that number doesn't make it non-whole, so both numbers are whole, giving us three whole numbers, the sum of the squares of two of which get you a the third, which is, by definition, a pythagorean triplet. Of course, although it's easy to verify something this way, no one would have ever thought of this from playing with equations (at least, I don't think so).
Also, nice way, but the way I did it was without many equations (one of the reasons I liked it so much). Now that we have spoilers, I'll include my answer and a few hints of how I got to it in a spoiler in the first post.
SPOILER
SPOILER_SHOW
Nobody ever notices my signature. ):
User avatar
testtubegames
Site Admin
Posts: 1148
Joined: Mon Nov 19, 2012 7:54 pm

Re: Difference of Squares and Pythagorean Triples

Post by testtubegames »

Nice, Random. Always partial to as-few-calculations-as-possible, I'll throw mine into the ring:
SPOILER
SPOILER_SHOW
x is your odd* number. let a=(x^2)/2.

Then your claim amounts to (a + .5)^2 = (a - .5)^2 + 2*a.

Or a^2 + a +.25 = a^2 - a + .25 + 2*a.

And all terms cancel. Yeah!

Edited to fix my "prime" typo!
A Random Player
Posts: 523
Joined: Mon Jun 03, 2013 4:54 pm

Re: Difference of Squares and Pythagorean Triples

Post by A Random Player »

testtubegames wrote:Nice, Random. Always partial to as-few-calculations-as-possible, I'll throw mine into the ring:
SPOILER
SPOILER_SHOW
x is your prime number. let a=(x^2)/2.

Then your claim amounts to (a + .5)^2 = (a - .5)^2 + 2*a.

Or a^2 + a +.25 = a^2 - a + .25 + 2*a.

And all terms cancel. Yeah!
Nice - substituting
SPOILER
SPOILER_SHOW
a term with the odd number squared to avoid fourth powers. I had already multiplied by 4 in my proof, but n^2 was a lot more elegant.
By the way, it's any odd number, not just the primes. (Though it technically works for any number - but instead of rounding, subtract and add .5)
$1 = 100¢ = (10¢)^2 = ($0.10)^2 = $0.01 = 1¢ [1]
Always check your units or you will have no money!
User avatar
testtubegames
Site Admin
Posts: 1148
Joined: Mon Nov 19, 2012 7:54 pm

Re: Difference of Squares and Pythagorean Triples

Post by testtubegames »

A Random Player wrote:By the way, it's any odd number, not just the primes. (Though it technically works for any number - but instead of rounding, subtract and add .5)
Whoops! Mistyped - thanks for catching that!
Post Reply