Problem

Source:

Tags: function, algorithm, modular arithmetic



Let $n$  be a positive integer. A row of $n+ 1$ squares is written from left to right, numbered $0, 1, 2, \cdots, n$ Two frogs, named Alphonse and Beryl, begin a race starting at square 0. For each second that passes, Alphonse and Beryl make a jump to the right according to the following rules: if there are at least eight squares to the right of Alphonse, then Alphonse jumps eight squares to the right. Otherwise, Alphonse jumps one square to the right. If there are at least seven squares to the right of Beryl, then Beryl jumps seven squares to the right. Otherwise, Beryl jumps one square to the right. Let A(n) and B(n) respectively denote the number of seconds for Alphonse and Beryl to reach square n. For example, A(40) = 5 and B(40) = 10. (a) Determine an integer n>200 for which $B(n) <A(n)$. (b) Determine the largest integer n for which$ B(n) \le A(n)$.