Consider the following sequence of numbers: 5 1 4 7 3 9 8 5 7 2 6 3 1 5 8 6 3 8 5 2 2 4 3 4 9 6 How many odd…
Consider the following sequence of numbers:
5 1 4 7 3 9 8 5 7 2 6 3 1 5 8 6 3 8 5 2 2 4 3 4 9 6
How many odd numbers are followed by the odd number in the above sequence?
5
6
7
8
Solution
Scanning consecutive pairs for an odd number immediately followed by another odd number: 5-1, 7-3, 3-9, 5-7, 3-1, 1-5 — these are the odd-followed-by-odd pairs, giving 6 occurrences.