When do positive integers $0<q_1<k_1$ and $0<q_2<k_2$ exist such that $q_1k_1+q_2k_2=k_1k_2$? Let $k_1$ and $k_2$ be positive integers. When do positive integers $0&lt;q_1&lt;k_1$ and $0&lt;q_2&lt;k_2$ exist such that $q_1k_1+q_2k_2=k_1k_2$?
I believe that these exist precisely when gcd$(k_1,k_2) \neq 1$. Is this correct? Does somebody have a proof?
Examples: for $k_1=3, k_2=6$, one has $4 \cdot 3 + 1 \cdot 6 = 18 $ and $2 \cdot 3 + 2 \cdot 6 = 18 $. However, for $k_1=2$, $k_2=3$, this never seems to happen.
Your assumption is indeed correct.

First, we show that it is a necessary condition:

Assume $GCD(k_1,k_2)=1$. If you take a look at your equation, we gain $k_2|q_1, k_1|q_2$ (why?). 

Since $q$ cannot be $0$, this leaves us with $q_1k_1+q_2k_2\geq k_1k_2+k_2k_1=2k_1k_2&gt;k_1k_2$.

Now, to prove that our condition is sufficient, we say $k_1=l_1d, k_2=l_2d$, where $GCD(l_1,l_2)=1$.

Now the equation writes $d(q_1l_1+q_2l_2)=d^2l_1l_2 \Leftrightarrow q_1l_1+q_2l_2=dl_1l_2$.

If we say $q_1=l_2r_1, q_2=l_1r_2$, putting that in leaves us with $r_1+r_2=d$, which can be fulfilled due to $d&gt;0$ and leaves us with a solution.
$$
(k_1-q_2)(k_2-q_1) = k_1k_2-k_1q_1-k_2q_2 +q_1q_2=q_1q_2
$$