Let $x$ and $y$ be positive integers such that
$45 < 8x + 5y < 60$
How many $(x,y)$ pairs can be found? (Ans: 16) Of course, there is a way to write it one by one. On the other hand there is a geometrical solution which is really nice but I don't want that. Can we write create and algebraic equation system that helps us to find the pairs. One of my friends talked my about the Diophantine equations, I don't have enough information about that so I don't know if it helps. Thank you in advance.
Consider the diophantine equation $$8x+5y=k$$ and choose one solution, say $(x,y)=(1,1)$, so we have $$\begin{cases} 8x+5y=k\\8*1+5*1=13\end{cases}\\$$ Take the difference $$8(x-1)+5(y-1)=k-13$$ We need $$45\lt{k-13}\lt60 \iff 58 \lt{k}\lt73$$ We have then $73-58=15$ solutions which finally gives with the solution $(x,y)=(1,1)$ the required 16 solutions.
NOTE.-The solution $(x,y)=(1,1)$ is a solution of the diophantine equation without restrictions but it must be consider in final computing the total of solutions after the condition $45\lt{k-13}\lt60$ (it is actually an auxiliary solution).