How to find all possible xy=k passing through integer points in n*n square

32 Views Asked by At

I want to find all possible xy=n passing through integer points such that 1 ≤ x ≤ n, 1 ≤y ≤ n

enter image description here

For ex.

Suppose n=4, then

Xy= 12 is a valid solution (it passes through (3, 4), which are both integer)

Xy=14 is not a solution, because there is no integer (a, b), where 1 ≤ a, b ≤ 4 such that ab=14. ,