We see sequences every day. A simple example is the flow of events over time. In mathematics and computer science, a sequence is a list of numbers. Particularly, a sequence of numbers must always be ordered. In most cases, we order from the smallest to the largest, but the order can also be decreasing (as long as the entire sequence is decreasing). A sequence of numbers may be finite or infinite. In programming settings, if we have no decisions and no repetition, the list of code instructions would be a sequence in itself. For example, in Python 3:
x = 3 print(x)
we see a two-step sequence. An ordered checklist also is a sequence too.
Instructions
If we have a sequence of numbers: -3, -1, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, what is the next value?
Assign your answer to checkpoint_1
in the code editor.
If we have a sequence of numbers: 2, 5, 8, 11, 14, 17, 20, 23, 26, what is the next value?
Assign your answer to checkpoint_2
in the code editor.