Solve discrete Math Problem using abstract algebra, postage problem? The question I am looking at is not very hard:
Determine which amounts of postage can be written with $5$ and $6$ cent stamps.
To determine the amount, use a brute force way to solve it.  Counting from $0$, see if each number can be written with $5$ and $6$. I can get $20$.(I can prove it's correct using strong induction.)
However, I am interested to see the structure of this problem. There are many different version of this problem where one have only $4$ and $5$ cent stamp, and etc.
I am wondering if there is a better way to determine the amount using some knowledge in abstract algebra maybe. The structure of putting $5$ and $6$ cents together reminds me of cosets of $5\mathbb{Z}$. I'd appreciate if you can share any thoughts on how to solve the problem differently? 
 A: Well, the best way I know to solve it is through Linear Diophantine Equations.  This may not be the solution you were looking for, but it does use the structure of $\mathbb{Z}/n\mathbb{Z}$ to some extent.  Consider the LDE $ax+by=1$ (this is where all your modular arithmetic comes in, in both the proof of existence and solving for $x,y$).  This equation is guaranteed infinitely many solutions $(x,y)$ in the integers given $GCD(a,b)=1$.  Based on this, we would like to determine when there exists a positive solution to $ax_n+by_n=n$ for some $n\in\mathbb{N}$.  If $a,b\in\mathbb{N}$, exactly one of $x,y\leq0$.  We know $a(nx)+b(ny)=n$.
Without loss of generality, assume $y\leq0$.  $x_n$ must be of the form $nx-kb$ while $y_n=ny+ka$.
So $\left\lfloor\frac{nx}{b}\right\rfloor\geq k\geq\left\lceil-\frac{ny}{a}\right\rceil=-\left\lfloor\frac{ny}{a}\right\rfloor$, or $\left\lfloor\frac{nx}{b}\right\rfloor+\left\lfloor\frac{ny}{a}\right\rfloor\geq0$ iff there exists a solution for $n$.
Note, for $n\geq\mathrm{lcm}(a,b)=ab$, $$\left\lfloor\frac{(ab+k)x}{b}\right\rfloor+\left\lfloor\frac{(ab+k)y}{a}\right\rfloor=ax+by+\left\lfloor\frac{kx}{b}\right\rfloor+\left\lfloor\frac{ky}{a}\right\rfloor=1+\left\lfloor\frac{kx}{b}\right\rfloor+\left\lfloor\frac{ky}{a}\right\rfloor\geq0$$
Since $y=\frac{1-ax}{b}$, $\left\lfloor\frac{ky}{a}\right\rfloor=\left\lfloor\frac{k}{ab}-\frac{kx}{b}\right\rfloor$, we can bound the sum of the floors to be
$$ \left\lfloor \frac{kx}{b}\right\rfloor-\left\lceil\frac{kx}{b}-\frac{k}{ab}\right\rceil\geq-1 $$
So we obtain that there is always a solution for $n\geq ab$.
Consider $n$, $n'=ab-n$:
$$\begin{align}
\left\lfloor \frac{nx}{b}\right\rfloor+\left\lfloor\frac{ny}{a}\right\rfloor+\left\lfloor\frac{(ab-n)x}{b}\right\rfloor+\left\lfloor\frac{(ab-n)y}{a}\right\rfloor&=1+\left\lfloor\frac{nx}{b}\right\rfloor+\left\lfloor\frac{ny}{a}\right\rfloor-\left\lceil\frac{nx}{b}\right\rceil-\left\lceil\frac{ny}{a}\right\rceil \\
&=1+\left(\left\lfloor\frac{nx}{b}\right\rfloor-\left\lceil\frac{nx}{b}\right\rceil\right)+\left(\left\lfloor\frac{ny}{a}\right\rfloor-\left\lceil\frac{ny}{a}\right\rceil\right) \\
&\geq1+(-1)+(-1)=-1
\end{align}$$
Thus, at least one of $n,\ n'$ has a solution.  Note that the equation indicates that $n, n'$ are both solutions iff $a|n$ or $b|n$.  Thus, exactly half of the numbers that are not multiples of $a$ or $b$ have a solution, so the amount without a solution is $\frac{ab-a-b+1}{2}$, and the amount with a solution for $n<ab$ is $\frac{ab-a-b+1}{2}+a+b-1=\frac{ab+a+b-1}{2}$.
Note: this method also gives the Frobenius number of $a,b$, or the largest number that has no solution.  We need only find the least $\alpha\in \mathbb{N}$ that has a solution and is not divisible by $a$ or $b$, and $ab-\alpha$ would then be the Frobenius number.  Plainly, $\alpha=a+b$, so the Frobenius number is $ab-a-b$.
A: If brute force is the way then you are looking for the largest number that cannot be obtained using these 2 units.
Find the lowest sequence of 5 values you can reach. Once you have that, then you can reach any number by just adding 5 cent stamps to one of the elements of this sequence.
You are looking for the first sequence of your low denomination.
If it's not clear enough write a comment and I'll try to explain.  
