First, express $\displaystyle r_{17}$ as the sum of $\displaystyle r_1$ and $\displaystyle r_2$

$\displaystyle r_{17} = r_{16} + r_{15}$

$\displaystyle r_{17} = 2r_{15} + r_{14}$

$\displaystyle r_{17} = 3r_{14} + 2r_{13}$

$\displaystyle r_{17} = 5r_{13} + 3r_{12}$

$\displaystyle r_{17} = 8r_{12} + 5r_{11}$

.

.

.

$\displaystyle r_{17} = 887r_{2} + 510r_{1}$

From this, I can express $\displaystyle r_{17}$ with the smallest positive integer coefficients modulo 10.

ie.

$\displaystyle r_{17} = 887r_{2} + 510r_{1} \equiv 7r_{2} + 0r_{1} = 7r_{2} \mod 10$

Notes:

So, as an example, if I know that my 2nd row contains elements "2", then I know my entries in my result row are $\displaystyle r_{17} = 7*2 \mod 10 = 14 \mod 10 \equiv 4 \mod 10.$ (It'll be a row of 4's.)

When adding rows, the process can be simpler using coordinate forms instead of writing out r_i's for each row, and if I 'drop the 10's' along the way. For example, $\displaystyle 13r_{11}$ has the same remainder as $\displaystyle 3r_{11}$ modulo 10. I don't show this here, but it was a good verification step to ensure my last row was correct.

To be aware of the cycle that exists, simply set rows $\displaystyle q_{1},q_{2} = r_{16},r_{17}$

EDIT:// Expressed in a more elementary way that doesn't use modulo but means the same thing:

$\displaystyle r_{17} = 887r_{2} + 510r_{1} = 880r_{2} + 510r_{1} + 7r_{2} = 10 * (88r_{2} + 51r_{1}) + 7r_{2}.$ The last digits of $\displaystyle 7r_{2}$ is what we'd see as a result of the operation described in the problem, for each entry.