so in my syllabus the professor wrote
$q = 500 / p - 4$
from which he deduced
$p = 500 / q + 4$
I cannot arrive at the same p, especially because of the positive 4...
so in my syllabus the professor wrote
$q = 500 / p - 4$
from which he deduced
$p = 500 / q + 4$
I cannot arrive at the same p, especially because of the positive 4...
On
To prove that your teacher make a mistake, let $p=1$, then $q=496$ from the first equation.
And we can easily see that with this choice of $q$, the RHS of the second equation is not an integer but $1$ is an integer.
Your teacher's answer would have been correct if he was solving $$q=\frac{500}{p-4}$$ instead.
As for your working, Matti has pointed out that you seems to have the consistent mistake of forgetting to multiply/divide certain terms.
Your professor made a mistake. The last $p$ is missing: $$ q p = 500 - 4p $$ But I wonder if he made it on purpose, to show that it leads to a wrong result.
The last derivation seems also not correct $$ \begin{align} q p &= 500 - 4p \iff \\ p &= 500/q - 4p/q \end{align} $$
I would reverse $q(p)$ like this: $$ \begin{align} q &= (500/p) - 4 \iff \\ q + 4 &= 500 / p \iff \\ p &= 500 / (q + 4) \end{align} $$ The last step is only valid for $q+4 \ne 0 \iff q \ne -4$.