Difficulty: Easy
If x 2 + y 2 = 3 9 2 , and x and y are positive integers, what is the value of x + y ?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
But it's a bit hard to find that 1 3 2 = 5 2 + 1 2 2
Log in to reply
It's one of those facts that you just know when doing years of maths. It's a useful one. Besides, this is a contest-type number theory problem; for number theory problems you'll have to know your pythagorean triples and square numbers well.
Here is the code:
1 2 3 4 |
|
1 2 3 |
|
x + y = 5 1
he he Nice one. I would've done it the same way myself lmao
If the output shown be correct, then there must be some error in programming. The first line is OK, in the second line, j is 1 more than required. The for looping should be rechecked.
Log in to reply
It was a minor typo sir. Thanku for correction. :)
Problem Loading...
Note Loading...
Set Loading...
3 9 2 = 3 2 × 1 3 2 = 3 2 × ( 5 2 + 1 2 2 ) = ( 3 × 5 ) 2 + ( 3 × 1 2 ) 2
So, one of x and y is 1 5 , and the other is 3 6
Hence their sum is 1 5 + 3 6 = 5 1 , a number that can be obtained by interchanging the positions of digits of one of x and y .