The same question is asked and answered here -- Move Point A along a line -- but with slightly different notation. Let's adapt one of its solutions to your $x$-$y$ coordinates.
The length of your original line segment from $(x_1,y_1)$ to $(x_2,y_2)$ is
\begin{equation}
L = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}.
\end{equation}
So if you happened to want the distance from $(x_1,y_1)$ to $(x,y)$ to be $L$, the answer would be trivial. But you want to move a different distance from $(x_1,y_1)$; specifically, you want the distance to be $n/L$ times as far. So we find $(x,y)$ this way:
\begin{equation}
x = x_1 + \frac{n}{L}(x_2 - x_1),
\end{equation}
\begin{equation}
y = y_1 + \frac{n}{L}(y_2 - y_1).
\end{equation}
So you just have to use these formulas to compute $L$ and then compute $x$ and $y$.
A word on how this works: In the case where $n = L$, this would add just enough to $x_1$ and $y_1$ so that you would reach $(x_2,y_2)$, but if $n < L$ it moves you to a point not so far from $(x_1,y_1)$, and if $n > L$ it moves you to a farther point, beyond $(x_2,y_2)$.