wu :: forums (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi)
riddles >> medium >> Squares: sums and differences
(Message started by: Christine on Mar 11th, 2013, 1:23pm)

Title: Squares: sums and differences
Post by Christine on Mar 11th, 2013, 1:23pm
My question is: how do you find sums and differences that are both squares?

x + y is a square
x - y is a square

Title: Re: Squares: sums and differences
Post by towr on Mar 11th, 2013, 1:44pm
(u+v)^2-u^2 = 2uv+v^2 = 2y
x = u^2+y
So basically we can take any u paired with an even v.

Title: Re: Squares: sums and differences
Post by pex on Mar 11th, 2013, 1:46pm
Or, equivalent but perhaps simpler: take any two squares that are either both even or both odd, say a2 and b2, and let x = (a2 + b2)/2 and y = (a2 - b2)/2.

Title: Re: Squares: sums and differences
Post by Immanuel_Bonfils on Mar 11th, 2013, 5:01pm
No restriction to x and y (unless being real, y guess), so

parity doesn't matter, even b>a   -> (y <0) would be OK

Title: Re: Squares: sums and differences
Post by Grimbal on Mar 12th, 2013, 4:00pm
It wasn't stated, but usually these problems ask for integer solutions.  If you are working with reals, every number >=0 is a square.

A simple set of solutions is x=a2 for some a and y=0.  It doesn't feel like a proper solution though.

On the other side, pex's method gives all integer solutions.

Title: Re: Squares: sums and differences
Post by Christine on Mar 19th, 2013, 10:34am
Thank you all for the feedback.

Sorry I did not state that
> I was looking for integer solutions,
> for producing interesting results (e.g. squares of prime numbers)

I'll make sure that next time I'll state clearly my questions.



Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board