I am looking for how to find integer approximations to scalar multiples of real valued vectors. This is close to the problem of finding a best rational approximation to a real number, but kind of generalized. Given an integer $k$, I would like to find an integer vector $z=(z_1, ..., z_n)\approx \lambda x$ for some $\lambda \ne 0$ which satisfies:
- $|z-\lambda x|$ is minimized.
- $z_i\leq k$ for all $i=1, ..., n$
- $\max_i z_i$ is minimized if there are multiple solutions that satisfy the above.
So, for example, given $x=(\pi, 2\pi)$ and $k=2$, a solution would be $(1, 2)$. I thought that something with continued fractions would work in the case where $n=2$ but I'm not sure how to generalize that for larger values of $n$.
EDIT
If it helps, I have a little bit more information about $x$. $x$ is a solution to $Ax=0$ where $A$ is $m\times n$ with $m=n-1$. The solution to this is given parametrically as $x=s(1, x_2, x_3, ..., x_n)$, and then I set $s=1$ to obtain $x=(1, x_2, ..., x_n)$. This is the $x$ that I am looking for the corresponding $z$ for in the problem above. So alternatively, I could say that I am looking for an integer valued "near-solution" to $Ax=0$. Maybe there is a different approach to my problem using this information? Although a general solution to the above problem that doesn't make use of this extra information would be nice both for application and to satisfy my curiosity.