Skip to main content
edited tags; edited title
Link
GH from MO
  • 105.4k
  • 8
  • 293
  • 398

Finding the greatest (smallest) factor of a number smaller (greater) than another number  

Source Link

Finding the greatest (smallest) factor of a number smaller (greater) than another number

Instead of iterating through all the possible numbers, is there a better way to find the greatest factor of a number $n$, such that it is less than $m$ ($m$ < $n$). Similarly how does one find the smallest factor of $n$ that is greater than $m$?