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)$.
Problem
Source:
Tags: function, algorithm, modular arithmetic
10000th User
04.11.2012 18:48
A diagram was included with the problem: \[\begin{array}{|c|c|c|c|c|} \hline 0&1&2&\qquad\dots\qquad&n\\ \hline \end{array}\]
Division equation
maplestory
09.11.2012 20:29
Using the division algorithm we let $A(n)=8q_A+r_A$ and $B(n)=7q_B+r_B$.
We want to minimize $B(n)$ so we let $r_B=0$ i.e. $n\equiv{0}\pmod{7}$. Now we test.
$7q_B\geq{200}\implies{q_B\geq{29}}$. Substituting this value for $q_A$ we get,
$q_A=29$ so $8(29)=232$. However, this is a multiple of $8$ but as we established earlier we want to minimize $B(n)$ so we use the next smallest multiple of $7$ which is $238$. We see that $34=B(238)<A(238)=35$ therefore $\boxed{n=238}$ works.