I was studying symmetries (as an introduction to Group Theory) and found this question-
Let $p,q$ be relatively prime positive integers and let $X$ be the set of integers that cannot be written as $ap+bq$ where $a,b$ are non-negative integers. For example, if $p=3$, $q=7$, then $X=\{1,2,4,5,8,11\}$
a. Find the largest element in $X$ in terms of $p$ and $q$.
b. Find the cardinality of $X$ (hint: plot the elements of $X$ on the real line and discover a hidden symmetry. In the example given, this gives: where the black dots represent the elements of $X$.
Now, after doing a little bit of trial and error, I guessed that the largest element in $X$ is $pq-p-q$. I can even prove that the equation $$ap+bq=pq-p-q$$ does not have any solutions in non-negative integers. But, how can I show that this is the largest number for which no such solution exists? Also, how is this question related to symmetry (if it at all is)?
About the second part, I can neither guess a solution, nor understand the hidden symmetry in the given diagram. Please help me with this.
Edit: Just came to know that part (a) is known as Coin Problem.
Edit 2: After the actual problem is solved, I'm curious of something else. We can see in the wiki article that the coin problem has elaborate solutions only for two coins. But, why can't we have any such beautiful symmetry for $n>2$ coins?