How many such 5's are there in the following number sequence, each of which is immediately preceded by 3 or 4 but not immediately followed by 8 or 9?
3 5 9 5 4 5 5 3 5 8 4 5 6 7 3 5 7 5 5 4 5 2 3 5 1 0
Answer & explanation
Correct answer: option 3
The correct answer is Option (3) → Five
A 5 is counted only when both conditions hold: the digit just before it is 3 or 4, and the digit just after it is not 8 or 9. So each 5 that comes after a 3 or a 4 is picked out first, and then the digit after it is checked.
3 5 9 (start) — followed by 9, not counted
4 5 5 (5th to 7th digits) — followed by 5, counted (1)
3 5 8 (8th to 10th digits) — followed by 8, not counted
4 5 6 (11th to 13th digits) — followed by 6, counted (2)
3 5 7 (15th to 17th digits) — followed by 7, counted (3)
4 5 2 (20th to 22nd digits) — followed by 2, counted (4)
3 5 1 (23rd to 25th digits) — followed by 1, counted (5)
The other 5s (the 4th, 7th, 18th and 19th digits) come after a 9, a 5 or a 7, so they are not counted at all.