(Btw we haven't used arrays yet. Im in my loop chapter)
I need to write a Java program that will output all pairs of positive integers, (a,b) such that a and b are greater than or equal to 0 and less than or equal to 1000 and the ratio (a^2 + b^2 + 1) / (a*b) is an integer.
My way to go about it is make a nested loop
for (a = 0; a <= 1000; a++)
for (b = 0; b <= 1000; b++)
{
//answer = a^2 + b^2 + 1 / (a*b)
//if (answer % 1 == 0)
// System.out.println("(" + a + ", " + b + ")")
}
would that work properly or am i looking at this problem all wrong