exercise 1
Each of a loop's passes does 9 steps, whatever the pass.
worked answer
- Pass 1, pass 2, and on to pass 40, each does 9, and lesson 4.4 gives .
- At that is .
Check it another way: At , , the one pass.
foundations
the puzzle
A loop's pass does steps, for from 1 to . How many steps does the whole loop do, as a formula in ?
Three lists, and which total each one takes.
| list | gaps | ratios | kind | total |
|---|---|---|---|---|
| 11, 19, 27, 35 | 8, 8, 8 | differ | fixed gap | |
| 2, 14, 98, 686 | 12, 84, 588 | 7, 7, 7 | made by multiplying | |
| 2, 5, 11, 23 | 3, 6, 12 | 2.5, 2.2: differ | neither | none yet |
The table takes the first list through, row by row: its gaps pick the total, its last term gives as in lesson 4.2, and the numbers go in.
| stage | 11, 19, 27 and on, up to 83 |
|---|---|
| kind | gaps 8, 8, so a fixed gap |
| count | , and gaps, so 10 terms |
| total | |
| check | , the last term is 11 too, so |
| check | second form, |
Then test it twice. A total of one term is that term, so must give , and the other form must give the same total.
A loop's step count, its steps added over every pass, is often a sum. In the puzzle, pass does steps, so the loop does .
Each pass raises by 1, so grows by 5. Passes 1, 2 and 3 do 7, 12 and 17, a fixed gap of 5, and .
runs from 1 to , so there are terms, and the last pass, , does .
The first form gives , which gathers to .
Check it. At it gives , the first pass. At it gives , and .
| steps of each pass | added | ||
|---|---|---|---|
| 1 | 7 | 7 | 7 |
| 2 | 7, 12 | 19 | 19 |
| 3 | 7, 12, 17 | 36 | 36 |
| 4 | 7, 12, 17, 22 | 58 | 58 |
Work each one out. Where there is a box, type your answer and check it. Each exercise's worked answer opens under it.
Each of a loop's passes does 9 steps, whatever the pass.
Check it another way: At , , the one pass.
A loop's pass 1 does 6 steps, and each pass does 5 times as many as the one before. It runs 4 passes.
Check it another way: Added by hand, .
A loop's counter runs from 1 to 20, one pass for each: pass 1 does 6 steps, and each pass does 5 more than the one before.
Check it another way: The last pass does steps, and the first form gives too.
A loop's pass does steps, for from 1 to .
Check it another way: At , gives , the first pass. Passes 1 and 2 do , and at it gives .