The pair of integers (0, 0) is written on a blackboard. In each step, we replace it...

Check the final answer first, then review the worked steps.

Answer

73

Work

Let $x_n, y_n$ be the pair. $x_{n+1} = x_n + y_n + c_n$, $y_{n+1} = y_n + c_n$.
$x_n = \sum_{i=0}^{n-1} y_i + \sum_{i=0}^{n-1} c_i = \sum_{i=0}^{n-1} (n-1-i)c_i + \sum_{i=0}^{n-1} c_i = \sum_{i=0}^{n-1} (n-i)c_i = 0$.
$247k - 118(n-k) = 0 \implies 247k = 118(n-k)$.
Since $\gcd(247, 118) = 1$, $k=118, n-k=247 \implies n=365$.
$m/5 = 365/5 = 73$.

Step-by-step solution

Let the pair be $(a_n, b_n)$. We want $a_n = 0$ for $n > 0$. Since $a_{n+1} = a_n + b_n + c_n$, we need $\sum_{i=0}^{n-1} (b_i + c_i) = 0$. Using the recurrence $b_{n+1} = b_n + c_n$, we find $a_n = \sum_{i=1}^{n-1} b_i + \sum_{i=0}^{n-1} c_i$. Solving for $a_n = 0$ with $c_i \in \{247, -118\}$ leads to $m=365$, so $m/5 = 73$.