# Algorithm 4

Carry out the following instructions.

- Draw a box, label the box A, write the number 1 in box A
- Draw a box, label the box S write the number 999 in box S
- Draw a line that values may be written on, label the line Output
- If the number in box A is less than or equal to 5 then do the next instruction, otherwise do instruction 9
- Replace the number in box S with the number in box A squared
- Write the number in box S on the line labeled Output
- Replace the number in box A with the number that is one more than the number currently in box A
- Go back and do instruction 4 again
- You are done

Describe the sequence of numbers on the Output line.

How did the number 999 put initially in box S in instruction 2 affect the result?

Note the second box, S, was used to "remember" the square of the the current value in box A.