How do you find all possible integer solutions of

$\displaystyle x^2 + y^2 = 41$

where x and y are integers.

Printable View

- Sep 24th 2012, 04:57 AMMathCrusaderFinding integer solutions for x² + y² = 41
How do you find all possible integer solutions of

$\displaystyle x^2 + y^2 = 41$

where x and y are integers. - Sep 24th 2012, 05:15 AMemakarovRe: Finding integer solutions for x² + y² = 41
You can do an exhaustive search. The absolute value of both x and y have to be less than 7.

- Sep 24th 2012, 06:25 AMMathCrusaderRe: Finding integer solutions for x² + y² = 41
Care to show me what you mean? I was thinking since x and y are integers they are either even or odd numbers. Therefore x = 2n and y = 2m where m and n are integers. And if x and y are odd we can let x = 2p + 1 and y = 2q + 1 where p and q are integers. However I am not sure who to go about from there.

- Sep 24th 2012, 06:35 AMemakarovRe: Finding integer solutions for x² + y² = 41
From Wikipedia:

Quote:

Brute-force search or exhaustive search, also known as generate and test, is a trivial but very general problem-solving technique that consists of systematically enumerating all possible candidates for the solution and checking whether each candidate satisfies the problem's statement.

A brute-force algorithm to find the divisors of a natural number n would enumerate all integers from 1 to the square-root of n, and check whether each of them divides n without remainder. A brute-force approach for the eight queens puzzle would examine all possible arrangements of 8 pieces on the 64-square chessboard, and, for each arrangement, check whether each (queen) piece can attack any other.

The numbers x and y cannot be both even or both odd because otherwise their squares are also both even or both odd and therefore the sum of squares is even.