Starting from:

$35

COSC 326 Threes

COSC 326
Threes
We are looking for sets of positive integers that satisfy the following conditions:
x
2 + y
2 = 1 + z
4
where z < x < y, and x, y, and z have no factors in common.
Task
Write a program to:
1. Find the first 70 sets ordered by increasing x, for x, y and z which satisfy the
above.
2. Find the first 70 sets ordered by increasing z, for x, y and z which satisfy the
above.
The output should be formatted as follows: each line should begin with the set number
(i.e., 1 through 70) followed by a single space and then the values of x, y and z (also
separated from one another by single spaces). The two sets of solutions should be
separated by a single blank line. If there are two solutions for a given value of the
“primary key” (i.e., x or z depending on which part of the task we’re looking at) then
they should be in order of the “secondary key” (resp., z or x). So (with completely
fictitious data), the output might begin something like:
1 3 4 5
2 3 6 7
3 5 12 13
Relates to Objectives
1.1 1.2 1.3 1.4 2.1 2.6 3.1 3.5 3.6
(1 point, Individual)

More products