Is there a neat way to find the largest integer that divides another integer fully, within a range. As an example, I would like to find the largest integer smaller than 1131 that divides 3500 completely.
So far I have just tried by breaking up 3500 into its prime components and guessing, coming to 875, but is there a more structured way?
EDIT: I guess the problem is somewhat equivalent to get all dividing integers, and then just pick the largest within my range?