0

I want to find numbers x and y such that x*y = N and |x-y| is minimum. For example;

7 = 7*1

15 = 5*3

16 = 4*4

Is there a fast way to find this?

Drethax
  • 25

1 Answers1

1

Find the largest number $\le\sqrt{N}$ that divides N. Let it be $a$. Then the required solution is $x=a$, $y=N/a$.

QED
  • 12,644