# Optimize for integers

#### idontknow

Optimize for integers the function: $$\displaystyle f(x)=\dfrac{px}{x-p} \;$$, p-parameter.

#### skipjack

Forum Staff
Does "optimize" mean "minimize the time needed to calculate" or something else?

idontknow

#### idontknow

Find Maximal and minimal value of the function for integers.

#### skipjack

Forum Staff
For $x \in \mathbb{Z}$, $f(x)$ is maximized when $x = \lfloor p \rfloor + 1$, and minimized when $x = \lceil p \rceil - 1$.

idontknow

#### idontknow

Can you post the method ?

#### skipjack

Forum Staff
I inspected the graph of the function for various values of $p$.

I didn't allow for $p = 0$, so that case needs to be considered separately.

Last edited:
idontknow