I have a question regarding solving values Period and Prescaller from the equation below
$$F_k = \frac{F_{mcu}}{(\text{Period} + 1) (\text{Prescaller} + 1)}$$
where $F_{mcu}$ and $F_k$ are known. Also, $F_{mcu} > F_k$. Period and Prescaller are 16 bit, they can take values from 0 to 65535. The point is to find values of Period and Prescaller so the equation will give as close value to known $F_k$ as possible. What would be the algorithm here that is more efficient than checking all possible values in a loop? I would appreciate all help.