Skip to main content
\(\renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{ #1}}{\thechapter~ #1}} \renewcommand{\sectionmark}[1]{} \newcommand{\abs}[1]{\left|#1\right|} \renewcommand{\theenumi}{5.\arabic{enumi}} \newcommand{\norm}[1]{\left\|#1\right\|} \newcommand{\norma}[1]{\left\|#1\right\|} \newcommand{\BM}[1]{\text{\boldmath$#1$}} \newcommand{\halmaz}[1]{\left\{\,#1\,\right\}} \newcommand{\halmazvonal}[2]{\left\{\,#1\mid #2\,\right\}} \newcommand{\halmazpont}[2]{\left\{\,#1:#2\,\right\}} \newcommand{\N}{\mathbb{N}} \newcommand{\len}{\norm} \newcommand{\var}[2][]{v_{#1}\left(#2\right)} \newcommand{\vari}[2]{v_{#1}\left(#2\right)} \newcommand{\size}[2][]{s_{#1}\left(#2\right)} \newcommand{\dep}[2][]{d_{#1}\left(#2\right)} \newcommand{\sizestar}[2][]{s_{#1}^*\left(#2\right)} \newcommand{\depstar}[2][]{d_{#1}^*\left(#2\right)} \renewcommand{\headrulewidth}{0pt} \newcommand{\lt}{<} \newcommand{\gt}{>} \newcommand{\amp}{&} \)

Section3.3Constructive proofs

In this section we deal with several problems for which a method can be provided to create a solution. We consider the coin problem (known also as the Frobenius problem). Let us be given a currency system with \(k\geq 2\) distinct integer denominations \(a_1\lt a_2\lt \ldots\lt a_k\text{.}\) Which amounts can be changed? This question yields the following linear Diophantine equation

\begin{equation*} a_1x_1+a_2x_2+\ldots+a_kx_k=n\text{,} \end{equation*}

where \(x_1,\ldots,x_k\) are non-negative integers. Now we study the case \(k=2\text{,}\) that is, our equation is

\begin{equation*} a_1x_1+a_2x_2=n\text{.} \end{equation*}

There are some natural questions to pose:

  • Does the equation possess integer solutions?

  • How many solutions does it have?

  • How to determine all solutions?

In what follows we consider the above problem but we allow integer solutions instead of non-negative integer solutions. We will use these results to answer the original question.

Assume that \(\gcd(a_1,a_2)=d\text{.}\) Since \(d\) divides \(a_1x_1+a_2x_2\) we easily get that \(d\) divides \(n\text{,}\) if there is a solution in integers. For example, if we consider the equation

\begin{equation*} 6x_1+8x_2=5\text{,} \end{equation*}

then 2 divides \(6x_1+8x_2\text{,}\) but 2 does not divide 5. Therefore there is no solution in integers.

Now suppose that \((u_1,u_2)\) is a solution, that is, \(a_1u_1+a_2u_2=n\text{.}\) Assume that there exists a different solution, say \((v_1,v_2)\text{.}\) We have that

\begin{align*} a_1u_1+a_2u_2\amp =n,\\ a_1v_1+a_2v_2\amp =n\text{.} \end{align*}

It implies that

\begin{equation*} a_1(u_1-v_1)=a_2(v_2-u_2)\text{.} \end{equation*}

Let \(b_1=a_1/d\) and \(b_2=a_2/d\text{.}\) Since \(d\) is the largest common divisor of \(a_1\) and \(a_2\text{,}\) we obtain that \(\gcd(b_1,b_2)=1\text{.}\) We simplify the above equation by \(d\) to get

\begin{equation*} b_1(u_1-v_1)=b_2(v_2-u_2)\text{.} \end{equation*}

It is clear that \(b_1\) divides \(v_2-u_2\text{,}\) since \(\gcd(b_1,b_2)=1\text{.}\) So we have \(v_2-u_2=b_1t\) for some \(t\in\mathbb{Z}\text{.}\) Thus

\begin{equation*} v_2=u_2+b_1t\text{,} \end{equation*}

and

\begin{equation*} v_1=u_1-b_2t\text{.} \end{equation*}

It follows that there are infinitely many integer solutions. We have proved that there is no solution if \(\gcd(a_1,a_2)\) does not divide \(n\text{,}\) and if there is a solution, then there are infinitely many integer solutions. In Section 1.3 we showed that one can use the Euclidean algorithm to determine integers \(x,y\) for which \(a_1x+a_2y=\gcd(a_1,a_2)=d\text{.}\) Now assume that \(d\) divides \(n\text{,}\) that is, \(n=n_1d\) for some \(n_1\text{.}\) We obtain the following equation

\begin{equation*} a_1xn_1+a_2yn_1=dn_1=n\text{.} \end{equation*}

Therefore \((xn_1,yn_1)\) is a solution of the equation \(a_1x_1+a_2x_2=n\text{.}\) Let us summarize what we obtained.

We apply the previous method to determine all integer solutions of the equation

\begin{equation*} 132x_1+187x_2=55\text{.} \end{equation*}

First we find the greatest common divisor of 132 and 187. We use the Euclidean algorithm:

\begin{align*} 187 \amp = 1\cdot 132+55\\ 132 \amp = 2\cdot 55+22\\ 55 \amp = 2\cdot 22 + 11\\ 22 \amp = 2\cdot 11 + 0\text{.} \end{align*}

That is, \(\gcd(132,187)=11\text{.}\) Since 11 divides 55 we know that there are infinitely many integer solutions. The next step is to construct a solution to the equation \(132x+187y=11:\)

\begin{align*} 11\amp = 55-2\cdot 22\\ \amp = 55-2\cdot (132-2\cdot 55)=-2\cdot 132+5\cdot 55\\ \amp = -2\cdot 132+5\cdot (187-132)=5\cdot 187-7\cdot 132\text{.} \end{align*}

We obtained that \(x=-7, y=5\) is a solution to the equation \(132x+187y=11\text{.}\) Hence we have

\begin{equation*} 132\cdot (-7\cdot 5)+187\cdot (5\cdot 5)=55\text{.} \end{equation*}

It implies that \(x_1=-35,x_2=25\) is a solution to the equation \(132x_1+187x_2=55\text{.}\) Our theorem yields that

\begin{equation*} \left(-35-17t, 25+12t\right) t\in\mathbb{Z} \end{equation*}

are solutions of the equation \(132x_1+187x_2=55\text{.}\)

We can handle equations of the form \(a_1x_1+a_2x_2=n\) in \(x_1,x_2\in\mathbb{Z}\text{.}\) If we have \(\gcd(a_1,a_2)=1\text{,}\) then we can solve the equation for any \(n\) in integers. What can we say about this equation if we allow only non-negative integers? Let us deal with the equation

\begin{equation*} 7x_1+11x_2=n\text{.} \end{equation*}

From the Euclidean algorithm we get that

\begin{equation*} 7\cdot(-3)+11\cdot 2=1\text{.} \end{equation*}

Thus we have that

\begin{equation*} (-3n,2n) \end{equation*}

is a solution to the equation \(7x_1+11x_2=n\text{.}\) From this particular solution we get infinitely many solutions:

\begin{equation*} (-3n-11t,2n+7t) t\in\mathbb{Z}\text{.} \end{equation*}

We would like to have non-negative solutions, hence

\begin{align*} -3n-11t\amp \geq 0\Rightarrow t\leq \frac{-3n}{11}\\ 2n+7t\amp \geq 0\Rightarrow t\geq \frac{-2n}{7}\text{.} \end{align*}

So we have the following inequalities

\begin{equation*} \frac{-2n}{7}\leq t\leq \frac{-3n}{11}\text{.} \end{equation*}

If there is an integer contained in the interval \([\frac{-2n}{7},\frac{-3n}{11}]\text{,}\) then \(n\) can be represented in the form \(7x_1+11x_2\text{.}\) Denote by \(I_n\) the set \(\halmazvonal{t}{ \frac{-2n}{7}\leq t\leq \frac{-3n}{11}, t\in\mathbb{Z}}\text{.}\)

\(n\) \(I_n\) \(n\) \(I_n\) \(n\) \(I_n\) \(n\) \(I_n\) \(n\) \(I_n\)
1 \(\emptyset\) 16 \(\emptyset\) 31 \(\emptyset\) 46 \(\halmaz{-13}\) 61 \(\halmaz{-17}\)
2 \(\emptyset\) 17 \(\emptyset\) 32 \(\halmaz{-9}\) 47 \(\halmaz{-13}\) 62 \(\halmaz{-17}\)
3 \(\emptyset\) 18 \(\halmaz{-5}\) 33 \(\halmaz{-9}\) 48 \(\emptyset\) 63 \(\halmaz{-18}\)
4 \(\emptyset\) 19 \(\emptyset\) 34 \(\emptyset\) 49 \(\halmaz{-14}\) 64 \(\halmaz{-18}\)
5 \(\emptyset\) 20 \(\emptyset\) 35 \(\halmaz{-10}\) 50 \(\halmaz{-14}\) 65 \(\halmaz{-18}\)
6 \(\emptyset\) 21 \(\halmaz{-6}\) 36 \(\halmaz{-10}\) 51 \(\halmaz{-14}\) 66 \(\halmaz{-18}\)
7 \(\halmaz{-2}\) 22 \(\halmaz{-6}\) 37 \(\emptyset\) 52 \(\emptyset\) 67 \(\halmaz{-19}\)
8 \(\emptyset\) 23 \(\emptyset\) 38 \(\emptyset\) 53 \(\halmaz{-15}\) 68 \(\halmaz{-19}\)
9 \(\emptyset\) 24 \(\emptyset\) 39 \(\halmaz{-11}\) 54 \(\halmaz{-15}\) 69 \(\halmaz{-19}\)
10 \(\emptyset\) 25 \(\halmaz{-7}\) 40 \(\halmaz{-11}\) 55 \(\halmaz{-15}\) 70 \(\halmaz{-20}\)
11 \(\halmaz{-3}\) 26 \(\emptyset\) 41 \(\emptyset\) 56 \(\halmaz{-16}\) 71 \(\halmaz{-20}\)
12 \(\emptyset\) 27 \(\emptyset\) 42 \(\halmaz{-12}\) 57 \(\halmaz{-16}\) 72 \(\halmaz{-20}\)
13 \(\emptyset\) 28 \(\halmaz{-8}\) 43 \(\halmaz{-12}\) 58 \(\halmaz{-16}\) 73 \(\halmaz{-20}\)
14 \(\halmaz{-4}\) 29 \(\halmaz{-8}\) 44 \(\halmaz{-12}\) 59 \(\emptyset\) 74 \(\halmaz{-21}\)
15 \(\emptyset\) 30 \(\emptyset\) 45 \(\emptyset\) 60 \(\halmaz{-17}\) 75 \(\halmaz{-21}\)

We can find 7 consecutive integers indicated in the table for which the set \(I_n\) is not empty, that is, those integers can be represented in the form \(7x_1+11x_2:\)

\begin{align*} n\amp =60 \amp x_1=(-3)\cdot 60-11\cdot(-17)=7, x_2=2\cdot 60+7\cdot(-17)=1,\\ n\amp =61 \amp x_1=(-3)\cdot 61-11\cdot(-17)=4, x_2=2\cdot 61+7\cdot(-17)=3,\\ n\amp =62 \amp x_1=(-3)\cdot 62-11\cdot(-17)=1, x_2=2\cdot 62+7\cdot(-17)=5,\\ n\amp =63 \amp x_1=(-3)\cdot 63-11\cdot(-18)=9, x_2=2\cdot 63+7\cdot(-18)=0,\\ n\amp =64 \amp x_1=(-3)\cdot 64-11\cdot(-18)=6, x_2=2\cdot 64+7\cdot(-18)=2,\\ n\amp =65 \amp x_1=(-3)\cdot 65-11\cdot(-18)=3, x_2=2\cdot 65+7\cdot(-18)=4,\\ n\amp =66 \amp x_1=(-3)\cdot 66-11\cdot(-18)=0, x_2=2\cdot 66+7\cdot(-18)=6\text{.} \end{align*}

Given a solution for \(n=60\) we can easily find a solution for \(n=67\) and \(n=74\) etc. We use this idea to provide solutions for all \(n>59\text{.}\) The Division algorithm says that if we divide an integer by 7, then the remainder is between 0 and 6.

If the remainder is 0, then from the equation \(63=7\cdot 9+11\cdot 0\) we get

\begin{equation*} 7(k+9)=7(k+9)+11\cdot 0, k\geq 0\text{.} \end{equation*}

That is, if we have an integer \(n\geq 63\) divisible by 7, then it can be written in the form \(7x_1+11x_2\) with \(x_1,x_2\geq 0\text{.}\)

If the remainder is 1, then we use the equation \(64=7\cdot 6+11\cdot 2\) to obtain

\begin{equation*} 7(k+9)+1=7(k+6)+11\cdot 2, k\geq 0\text{.} \end{equation*}

In a similar way one computes the general solutions for the remaining cases.

How to deal with equations with more than two variables? We show how to reduce equations in three unknowns to equations in two unknowns. So the techniques applied previously can be used here. Consider the equation

\begin{equation*} 4x_1+5x_2+7x_3=n, x_1,x_2,x_3\in\mathbb{Z}\text{.} \end{equation*}

Introduce a new variable \(y_1=4x_1+5x_2\text{,}\) then the equation can be written as

\begin{equation*} y_1+7x_3=n\text{.} \end{equation*}

A particular solution is \((n,0)\text{,}\) hence all the integer solutions can be parametrized as follows

\begin{align*} y_1\amp =n+7t,\\ x_3\amp =-t\text{,} \end{align*}

for some \(t\in\mathbb{Z}\text{.}\) It remains to determine the integer solutions of the equation \(y_1=4x_1+5x_2=n+7t\text{.}\) The first thing to do is to find a particular solution. It is easy to check that

\begin{align*} x_1\amp =-n+3t,\\ x_2\amp =n-t \end{align*}

is a solution. Applying the techniques used in case of two variables we get the following parametrization of integral solution

\begin{align*} x_1\amp =-n+3t-5s,\\ x_2\amp =n-t+4s,\\ x_3\amp =-t \end{align*}

for some \(s,t\in\mathbb{Z}\text{.}\) As a concrete example consider the equation \(4x_1+5x_2+7x_3=23\text{.}\) Then we obtain integer solutions by substituting concrete integral values into the above formulas. Some solutions are indicated in the following table

\((s,t)\) \((x_1,x_2,x_3)\)
\((0,0)\) \((-23, 23, 0)\)
\((-1,0)\) \((-18, 19, 0)\)
\((0,-1)\) \((-26, 24, 1)\)
\((1,0)\) \((-28, 27, 0)\)
\((0,1)\) \((-20, 22, -1)\)
\((-1,-1)\) \((-21, 20, 1)\)
\((1,1)\) \((-25, 26, -1)\)

What about non-negative integer solutions? That is, if one asks for solutions such that \(x_1,x_2,x_3\in\mathbb{N}\cup\halmaz{0}\text{.}\) In case of the equation \(4x_1+5x_2+7x_3=n\) we determined the parametrization of the integral solutions, so we get the following inequalities

\begin{align*} 0\amp \leq -n+3t-5s,\\ 0\amp \leq n-t+4s,\\ 0\amp \leq -t\text{.} \end{align*}

That is, we immediately see that \(t\leq 0\text{.}\) We try to eliminate \(s\) from the first and the second equations. So we multiply by 4 the first equation and by 5 the second one and we get

\begin{equation*} 5t-5n\leq 20s\leq -4n+12t\text{.} \end{equation*}

That is, we obtain that

\begin{equation*} -\frac{n}{7}\leq t\leq 0\text{.} \end{equation*}

It remains to determine a lower bound and an upper bound for \(s\text{.}\) We have

\begin{equation*} 20s\geq 5t-5n\geq -5\frac{n}{7}-5n\text{,} \end{equation*}

hence \(s\geq -\frac{2n}{7}\text{.}\) Similarly, we have

\begin{equation*} 20s\leq -4n+12t\leq -4n\text{,} \end{equation*}

therefore \(s\leq -\frac{n}{5}\text{.}\) Let us denote the two intervals as \(I_s=[-\frac{2n}{7},-\frac{n}{5}]\) and \(I_t=[-\frac{n}{7},0]\text{.}\) To have a non-negative integer solution we need an integer contained in the interval \(I_s\) and another one contained in \(I_t\text{.}\) If the length of the interval \(I_s\) is at least 1 and similarly for \(I_t\text{,}\) then for sure there will be such integers. The length of \(I_s\) is \(-\frac{n}{5}+\frac{2n}{7}=\frac{3n}{35}\) and the length of \(I_t\) is \(\frac{n}{7}\text{.}\) We have that the length of \(I_s\) is at least 1 if \(n\geq 12\) and the length of \(I_t\) is at least 1 if \(n\geq 7\text{.}\) If \(n\geq 12\text{,}\) then an integer solution is guaranteed. It means that if \(n\geq 12\text{,}\) then the equation \(4x_1+5x_2+7x_3=n\) has non-negative integer solution. Now we deal with the remaining cases \(1\leq n\leq 11\text{.}\)

\(n\) integer(s) in \(I_s\) integer(s) in \(I_t\) solution(s): \((x_1,x_2,x_3)\)
1 - 0 -
2 - 0 -
3 - 0 -
4 -1 0 \((1,0,0)\)
5 -1 0 \((0,1,0)\)
6 - 0 -
7 -2 -1,0 \((0,0,1)\)
8 -2 -1,0 \((2,0,0)\)
9 -2 -1,0 \((1,1,0)\)
10 -2 -1,0 \((0,2,0)\)
11 -3 -1,0 \((1,0,1)\)

We proved that if \(n>6\text{,}\) then the equation \(4x_1+5x_2+7x_3=n\) has non-negative integer solution.

Prove that all integers \(n\geq 24\) can be written as \(5x_1+7x_2\) for some non-negative integers \(x_1,x_2\text{.}\)

Prove that all integers \(n\geq 12\) can be written as \(4x_1+5x_2\) for some non-negative integers \(x_1,x_2\text{.}\) Determine a formula for the solution in case of integers of the form \(n=4K+1\text{.}\)

Parametrize all integer solutions of the equation

\begin{equation*} 4x_1+6x_2+9x_3=n\text{.} \end{equation*}

Determine the largest positive integer \(n\) for which the equation

\begin{equation*} 4x_1+6x_2+9x_3=n \end{equation*}

has no non-negative integer solution.