2 The following steps define an algorithm which acts on two numbers.
STEP 1 Write down the two numbers side by side on the same row.
STEP 2 Beneath the left-hand number write down double that number. Beneath the right-hand number write down half of that number, ignoring any remainder.
STEP 3 Repeat STEP 2 until the right-hand number is 1.
STEP 4 Delete those rows where the right-hand number is even. Add up the remaining left-hand numbers. This is the result.
- Apply the algorithm to the left-hand number 3 and the right-hand number 8.
- Apply the algorithm to the left-hand number 26 and the right-hand number 42.
- Use your results from parts (i) and (ii), together with any other examples you may choose, to write down what the algorithm achieves.