題組內容

8. (20%) Finish a recursive function for solving a jumping Takahashi problem. Assuming that Takahashi is standing at coordinate 0 on a number line. He will now perform 4 jumps forward towards the positive direction. At each jump, he can take a stride of either 2 or 5 steps forward on the line. For example, after the first jump, he can reach coordinates {2, 5}.
63c0b854627d8.jpg

(a) How many coordinates along the number line can he reach (including the starting point at coordinate 0)? Drive this result by paper-and-pencil method. (5%)