Is there any method to check whether there exist positive integral solutions $(x,y)$ for the equation
$$ax + by = n $$ given $$a,b,n \in \mathbb{Z}^+$$
Also, please note $a$ and $b$ were given, and the following relations exist:
- $a > b$
- $a + b \le n$
Note that $\mathbb Z^+ = \{1,2,3,\dots\}.$
The Chicken McNugget Theorem (or Postage Stamp Problem or Frobenius Coin Problem) states that for any two relatively prime positive integers $a,b$, the greatest integer that cannot be written in the form $ax+by$ for nonnegative integers $x,y$ is $(a-1)(b-1)-1 = ab-a-b.$
A corollary of the proof states that every integer $c \ge (a-1)(b-1)$ can be written in the form $ax+by=c$, where $x,y \in \mathbb Z^+$, in exactly one way. So you may want to also exclude multiples of $a$ and multiples of $b$ since they require that either $x$ or $y$ be equal to $0$.