Start free

Whole-number solutions of ax + by = c Which whole numbers solve 3x + 5y = c, and how can you be sure you have found them all?

Maths olympiad · 45 minutes

Students find which totals 3p and 5p stamps can make, see the whole-number solutions as points on a line, discover that they step along by (5, −3), and prove why. Then: when there are none, and how to count the positive ones. Slides, a vote that shows who's stuck, problems up to olympiad level, and short proofs to mark.

Present and print without signing in.

Use in my lessons

Free. The whole lesson is copied into your Library, yours to change.

Stamps cost 3p and 5p. Move c, the total. The marked points are the whole-number solutions of 3x + 5y = c. Which totals can you make with x and y both 0 or more, and which can't you make?

2468

Whole-number points: (−1, 4), (4, 1), (9, −2)

The idea in one minute

An equation such as 3x + 5y = 22 is a line, and its whole-number solutions are the grid points on it: (4, 2), (9, −1), (−1, 5) and so on. They come at equal steps of 5 across and 3 down, because if two solutions differ by (d, e), then 3d + 5e = 0, so 5 divides 3d, and as 3 and 5 share no factor, 5 divides d. When a and b share a factor that does not divide c, there are no whole-number solutions at all.

The lesson goes problem first. Students try to make every total from 1p to 20p with 3p and 5p stamps, then watch the line 3x + 5y = c move with its grid points marked. They list solutions, spot the step, and only then prove why it must be so. From there: equations with no solutions, counting the positive solutions with an inequality, and the largest total that can't be made, as olympiad-style problems with written arguments the teacher marks.

By the end, students can

  • find one whole-number solution of ax + by = c, then all of them
  • explain why the solutions step by (b, −a) when a and b share no factor
  • show that an equation has no whole-number solutions using a common factor
  • count the solutions with x and y positive, and solve stamp and coin problems

Key words

  • whole-number (integer) solution
  • linear Diophantine equation
  • lattice point
  • highest common factor (gcd)
  • general solution

Before this lesson

Students should substitute into an equation, know factors and the highest common factor, and read points on a straight-line graph.

Taught in Counting routes on a grid.

The lesson, step by step

45 minutes in total. The stretch is optional.

  1. 1 · Think5 min

    Stamps of 3p and 5p

    You have as many 3p and 5p stamps as you like.

    Which totals from 1p to 20p can you make exactly?

    Which can't you make?

    Is there a total after which you can make everything?

    Make a table: the total, and how you made it.

    Write here

    5 min 1 · Hook · students think · the slides say “Think”

    Stamps of 3p and 5p

    Students find which totals 3p and 5p stamps can make before anyone explains.

    Say

    “You have as many 3p and 5p stamps as you like. Which totals from 1p to 20p can you make exactly? Which can't you make? Is there a total after which you can make everything?”

    Ask
    • How did you make 17p? Is there another way?
    • You can make 8p, 9p and 10p. Why does that mean you can make 11p, 12p and 13p?
    Watch for

    Students who stop at 'I can't make 7p' with no reason: ask how they know they tried every way.

    For the teacher

    Give three minutes with a table: total, and how to make it. Most find 3, 5, 6, 8, 9, 10 quickly and struggle to be sure about 7.

    Don't explain yet. Ask how many ways there are to make 30p (three: ten 3p; five 3p and three 5p; six 5p) and whether the ways have a pattern.

    Collect the totals that can't be made (1, 2, 4 and 7) without confirming. Keep the question 'how do you know?' for the end of the lesson: it is the stretch.

    Shorter: Ask for 1p to 12p only, and the ways to make 30p (−2 min).

  2. 2 · Watch12 min

    Grid points on a line

    3x + 5y = 22

    (4, 2): 12 + 10 = 22

    (−1, 5) and (9, −1) work too.

    Each step: 5 across, 3 down.

    Find the next one. And the one before?

    2 · Watch

    Why steps of (5, −3)?

    Two solutions: 3x + 5y = 22 and 3p + 5q = 22

    Subtract: 3(x − p) = 5(q − y)

    5 divides 3(x − p), and 5 shares no factor with 3,

    so 5 divides x − p: x moves in steps of 5,

    and y moves 3 the other way.

    All solutions: x = 4 + 5t, y = 2 − 3t

    Name it: a linear Diophantine equation.

    2 · Watch

    When there are none

    2x + 4y = 5

    2x + 4y is always even; 5 is odd.

    6x + 9y = 20: the left side is a

    multiple of 3, so none either.

    Solutions exist exactly when

    the HCF of a and b divides c.

    The line misses every grid point.

    2 · Watch

    Count the positive ones

    3x + 5y = 100: one solution is (0, 20)

    All: x = 5t, y = 20 − 3t

    x ≥ 1 needs t ≥ 1

    y ≥ 1 needs 3t ≤ 19, so t ≤ 6

    t = 1, 2, 3, 4, 5, 6: six solutions

    Turn 'positive' into inequalities for t.

    12 min 2 · Explain · you explain · the slides say “Watch”

    Discover it, then name it

    The solutions as grid points on a line, the step between them and why, no solutions, counting.

    Say

    “Every whole-number solution of 3x + 5y = 22 is a grid point on its line. Find three, and look at how you get from one to the next.”

    Ask
    • From (4, 2), what is the next solution? And the one before?
    • Could two solutions be closer than 5 apart in x? Why not?
    • 6x + 9y = 20: try a few. What do you notice about the left side?
    Watch for

    Moving both x and y up: to keep 3x + 5y fixed, x goes up 5 while y goes down 3.

    Find one, then all

    3x + 5y = 22: try y = 0, 1, 2… y = 2 gives 3x = 12, x = 4

    Step 5 across, 3 down: (9, −1), (14, −4)…

    and back: (−1, 5), (−6, 8)…

    All: x = 4 + 5t, y = 2 − 3t for any whole number t

    Why the step is (5, −3)

    Two solutions: 3x + 5y = 22 and 3p + 5q = 22

    Subtract: 3(x − p) = 5(q − y)

    5 divides 3(x − p) and shares no factor with 3, so 5 divides x − p

    So x moves in steps of 5, and then y moves 3 the other way

    Count the positive ones

    3x + 5y = 100: one solution is x = 0, y = 20

    All: x = 5t, y = 20 − 3t

    x ≥ 1 needs t ≥ 1; y ≥ 1 needs 3t ≤ 19, so t ≤ 6

    t = 1, 2, 3, 4, 5, 6: six solutions

    For the teacher

    First slide: the line 3x + 5y = 22 with its grid points. Students find (4, 2) by trying y = 0, 1, 2. Then they find others and say the step: 5 across, 3 down.

    Second slide: why. Two solutions subtracted give 3(x − p) = 5(q − y). 5 divides the right side, so it divides the left; 5 shares no factor with 3, so 5 divides x − p. That is a proof: it covers every solution, not just the ones we found. Name it: an equation like this, solved in whole numbers, is a linear Diophantine equation, and x = 4 + 5t, y = 2 − 3t is its general solution.

    Third slide: none. 2x + 4y is always even and 5 is odd: the line passes between the grid points. Likewise 6x + 9y is always a multiple of 3, and 20 is not. In general ax + by = c has whole-number solutions exactly when the highest common factor of a and b divides c (the 'if' part, that a solution then exists, is a fact worth knowing; its proof can wait). When they share a factor that does divide c, divide it out first: 4x + 6y = 20 is 2x + 3y = 10, so its solutions step by (3, −2), not (6, −4).

    Fourth slide: count. Write the general solution, then turn 'positive' into inequalities on t.

    Vote before you move c on the slide (Ask the class): will 3x + 5y = 7 have any marked points with both x and y 0 or more?

    Shorter: Find one, the step and why; no solutions and counting as one slide to read (−4 min).

  3. 3 · Your turn8 min

    Worked, then yours

    I do: 2x + 7y = 30. y = 0 gives x = 15.

    One with y = 4: x = 1. All: x = 1 + 7t, y = 4 − 2t

    You do: 4x + 3y = 25. One solution, then all.

    Put each solution back in to check.

    Write here

    3 · Your turn

    Two more pairs

    I do: 8x + 12y = 30. A multiple of 4 can't be 30: none.

    You do: 9x + 6y = 51. Any? Find one if so.

    I do: 2x + 7y = 30, x and y positive:

    t = 0 or 1: (1, 4) and (8, 2)

    You do: 4x + 3y = 25, x and y positive. How many?

    Write here

    Its answers' slide comes with your copy.

    8 min 3 · Your turn · students write

    Worked, then yours

    Each worked example beside a twin that students solve themselves.

    Say

    “Watch me do one. Then you do its twin. Check every solution by putting it back in.”

    Ask
    • Which way does y go when x goes up? How do you know before you work it out?
    Watch for

    Stepping by (3, 5) or (2, 7) the wrong way round: x steps by y's number.

    Find one, then all

    2x + 7y = 30: y = 0 gives x = 15

    All: x = 15 + 7t, y = −2t (or x = 1 + 7t, y = 4 − 2t)

    Then theirs

    4x + 3y = 25: one solution, then all

    Any at all?

    8x + 12y = 30

    The left side is a multiple of 4; 30 is not

    No whole-number solutions

    Then theirs

    9x + 6y = 51: any solutions? Find one if so

    How many positive?

    2x + 7y = 30: x = 1 + 7t, y = 4 − 2t

    x ≥ 1: t ≥ 0. y ≥ 1: t ≤ 1

    Two: (1, 4) and (8, 2)

    Then theirs

    4x + 3y = 25: how many with x and y positive?

    For the teacher

    Work the first example aloud, writing each line. Then students solve its twin, and check each solution in the equation.

    Do the same for each pair. The third pair uses the first: the general solution, then the inequalities.

    Open the answers slide once most have finished their twins. For the second twin, ask for a reason either way: a common factor that settles it, or a solution put back in.

    Shorter: Do the first two pairs only (−3 min).

  4. 4 · Vote and practise15 min

    Vote first

    3x + 5y = 60. How many solutions

    have x and y both positive?

    A: 3

    B: 5

    C: 4

    D: Infinitely many

    Choose on your own, then say why.

    4 · Vote and practise

    Climb: show your working

    1. 3x + 5y = 31, (2, 5): the next solution?

    2. 5x + 2y = 29, positive, smallest y

    3. Which has no solutions? (on your quiz)

    4. Pens 7p, rubbers 4p: exactly 50p

    5. Why does 10x + 4y = 33 have none?

    Stuck? Find one solution, then step.

    Write here

    4 · Vote and practise

    Olympiad level

    6. 5x + 7y = 200: how many positive?

    7. 4p and 7p stamps: the largest total you can't make?

    8. Prove: 3p and 5p make every total from 8p up.

    9. 3x + 5y = 1000: how many positive?

    Try small cases, find the pattern, then prove it.

    15 min 4 · Who's stuck? · students vote · the slides say “Vote and practise”

    Vote, then climb

    One question shows who's stuck; then problems that climb from fluency to olympiad level.

    Say

    “Choose an answer on your own. Nobody talks until everyone has chosen. Then work up the problems as far as you can; the last ones are olympiad level.”

    Ask
    • Have you checked the first and last solution you counted in the equation?
    Watch for

    Solutions with x or y equal to 0 counted as positive; a slip at one end of the range of t; the word 'positive' forgotten.

    Whole numbers may be negative unless the question says positive. Show your working on paper. Questions 5 and 8 need a written explanation.

    The question that shows who's stuck

    1. How many solutions of 3x + 5y = 60 have x and y both positive whole numbers?
      1. 3
      2. 5
      3. 4
      4. Infinitely many
    In your Classroom, as they answer (an example)
    • A10
    • B7
    • C4
    • D5

    Each wrong answer is a different mistake. While they answer, your Classroom shows who chose which, so you know in seconds whom to help with what.

    1. 3x + 5y = 31 has the solution x = 2, y = 5. The next solution with a bigger x is x = ___, y = ___
    2. 5x + 2y = 29 has three solutions with x and y both positive. In the one with the smallest y, what is x?
    3. Which equation has no whole-number solutions?
      1. 4x + 6y = 15
      2. 4x + 6y = 14
      3. 3x + 7y = 1
      4. 5x + 10y = 35
    4. Pens cost 7p and rubbers 4p. Sam spends exactly 50p and buys at least one of each. In how many different ways can Sam do it?
    5. Explain why there are no whole numbers x and y with 10x + 4y = 33.
    6. How many solutions of 5x + 7y = 200 have x and y both positive whole numbers?
    7. With as many 4p and 7p stamps as you like, what is the largest total you cannot make exactly?
    8. Stretch: prove that every whole-number total of 8p or more can be made with 3p and 5p stamps.
    9. Stretch: how many solutions of 3x + 5y = 1000 have x and y both positive whole numbers?

    Support · For question 1: from the solution you are given, x goes up 5 and y goes down 3. For the counting questions: find one solution, write all of them with t, then write 'x ≥ 1' and 'y ≥ 1' as inequalities in t. For question 7: list the totals you can make; once you can make four in a row, you can make every total after them.

    For the teacher

    Everyone chooses before anyone explains. Then ask a student for each answer to list the solutions behind it, and the class to test each one: is it a solution, and are x and y both positive? Zeros, the ends of the range of t and the word 'positive' all show up here.

    Questions 1–2 build fluency; 3–4 give the same idea a new look; 5 asks for a written reason; 6–7 are competition style; 8 and 9 are olympiad level.

    Students show their working on paper or the board; the quiz keeps their final answers, and the written ones come to you to mark.

    If the class is split, ask every student to write out the solutions they counted and tick each one twice: is it in the equation, and are x and y both positive? Long answers (5, 8) are marked by you: one mark for the idea, one for each step with its reason, one for the conclusion. Model answers are in each question's explanation.

    Shorter: After the vote, questions 1–5 only (−6 min).

    Longer: Question 8 written up in full, then read aloud and improved together (+10 min).

  5. 5 · Show what you know5 min

    All of them, and why

    4x + 7y = 3

    Find every whole-number solution.

    How do you know there are no others?

    One solution, the rule, then a sentence.

    Write here

    5 min 5 · Exit · students show · the slides say “Show what you know”

    All of them, and why

    One general solution with a reason shows who knows they have every solution.

    Say

    “Find every whole-number solution, and say in a sentence how you know there are no others.”

    Watch for

    A list of three solutions with 'and so on': the answer is a rule for all of them, with a reason.

    One solution, the rule for all of them, and a sentence.

    1. Find all whole-number solutions of 4x + 7y = 3. How do you know there are no others?
    For the teacher

    Find all whole-number solutions of 4x + 7y = 3.

    A full answer gives one solution, the rule for all of them, and why no others exist.

    The reasons show who has the proof and who has only the pattern: start the next lesson with one of each (anonymous). Set the homework.

    Longer: Swap answers and mark a partner's reason: is it a proof or a pattern? (+5 min).

One to one: ask the student to find three solutions before you say anything about steps, and to predict the next one; then ask them to explain why it can't be any other step, out loud first, then in writing.

Homework: find them all

Whole numbers may be negative unless the question says positive. Check every solution by putting it back in. Question 6 is a written proof: write it as you would in an olympiad.

  1. Find one whole-number solution of 5x + 3y = 31, then write down all of them.
  2. Does 10x + 15y = 42 have any whole-number solutions? Explain.
  3. How many solutions of 4x + 9y = 100 have x and y both positive?
  4. Adult tickets cost £7 and child tickets £4. A group spends exactly £100 and buys at least one of each. List every possibility.
  5. With 5p and 8p stamps, what is the largest total you cannot make? Show that every larger total can be made.
  6. Prove that if two solutions of 3x + 5y = c are different, their x values differ by at least 5.

Print the worksheet with working space and homework. Teacher answers come with your Library copy.

Teaching whole-number solutions of ax + by = c: common questions

Why do the whole-number solutions of ax + by = c come at equal steps?

Take two solutions and subtract: a times the change in x equals minus b times the change in y. If a and b share no factor, b must divide the change in x, so x moves in steps of b and y in steps of a the other way. If they share a factor d, the steps are b ÷ d and a ÷ d.

When does ax + by = c have no whole-number solutions?

When the highest common factor of a and b does not divide c. Every value of ax + by is a multiple of that factor, so c must be one too. When it is, there are always solutions, and infinitely many: one solution and the step give them all.

What is the stamps (or coins) problem?

With stamps of two values that share no factor, every large enough total can be made, and there is a largest total that can't. For 3p and 5p it is 7p. Students find it by listing totals, and prove it by finding a run of consecutive totals as long as the smaller stamp, then adding that stamp.

Which competitions use problems like these?

Whole-number solutions of equations, coins and stamps come up in junior and intermediate maths challenges, their olympiad rounds and national olympiads. This lesson's problems are written for it; it uses no past papers.

Can I use the lesson without creating an account?

Yes. Read the lesson, print the worksheet and open its slides without signing in; nothing you draw there is kept. A free teacher account keeps the whole lesson in your Library to change and teach, with the quizzes, the answers and the answer slides.

Teach this lesson tomorrow

Keep the whole lesson, change what you like, and use it with a group. Present its slides step by step while each student works on their own copy.

Use in my lessons

Free. The whole lesson is copied into your Library, yours to change.

In our own words; free to use with your students. Not endorsed by any exam board.