Number of values of expression $\frac{k}{3} + \frac{m}{8}$ which are less than 6

Values of expression: $$\frac{k}{3} + \frac{m}{8}$$ for k,m$\in Z^+ $ $$ $$ I tried to calculate the numbers of k for a particular m, but I got stuck and it won't help in generalizing for different equations of similar type.
EDIT 1:
My method:
for k=1, we will get $$m<48- \frac{8}{3}$$
So we can get 47 values of m for k=1.
Similarly if repeat this process we can get a pattern. But how can we be sure that it will not give the same value of the expression for two different values of k,m. Am I missing something?
EDIT 2:
For Example we assume $(k_1,m_1)$ and $(k_2,m_2)$ gives the same value so, $$\frac{k_1}{3}+\frac{m_1}{8}= \frac{k_2}{3}+\frac{m_2}{8}$$ which gives us $$ \frac{k2-k1}{m1-m2}=\frac{3}{8}$$ and many (k,m) pairs can satisfy this which will lead to overcounting if we brute force.
Any help would be appreciated.


Solution 1:

We are looking at the number of possible values of $\frac{k}{3}+\frac{m}{8}$ (with $k,m\in\mathbb Z, k,m\ge 1$) smaller than $6$, which is the same as looking at the number of possible values of $8k+3m$ smaller than $144$. This is again the same as the number of possible values of $8k+3m$ with $k,m\ge 0$ smaller than $133$. (The change of variable: $k\to k-1, m\to m-1$ makes the sum smaller by $11$.) This means - the number of possible values of $8k+3m$ between $0$ and $132$. ($133$ possibilities in total.)

Thus, this problem becomes an instance of the Coin problem with $n=2$ terms/coins.

Now, we can see that we can definitely make the values $$14=8+2\times 3$$ $$15=3\times 3$$ $$16=2\times 8$$ which implies that we can make any bigger value - just add enough "threes" to one of $14$, $15$ or $16$ (depending on the value $\pmod 3$). As for the values $0-13$, we can see that we can make $0, 3, 6, 9, 12$ and also $8, 11$ and no others: we cannot make $1,2,4,5,7,10,13$ (seven of them). Thus, the total number of achievable values is $133-7=126$.