# Problem of the Week Problem E and Solution Two Digits at a Time

## Problem

The number $$34\,692$$ contains $$5$$ digits, and so we say its digit length is $$5$$. The first digit of $$34\,692$$ is $$3$$. Also, the two-digit integers formed by choosing any pair of consecutive digits, that is, $$34$$, $$46$$, $$69$$, and $$92$$, are all divisible by either $$17$$ or $$23$$.

An integer with digit length $$2022$$ has first digit $$3$$. This integer also has the property that the two-digit integers formed by choosing any pair of consecutive digits are all divisible by either $$17$$ or $$23$$.

List all of the possibilities for the last three digits of this integer.

## Solution

We first list out all two-digit multiples of $$17$$ and $$23$$.
The two-digit multiples of $$17$$ are $$17$$, $$34$$, $$51$$, $$68$$, and $$85$$.
The two-digit multiples of $$23$$ are $$23$$, $$46$$, $$69$$, and $$92$$.

Since the integer starts with a $$3$$ and the only two-digit number in the two lists that starts with a $$3$$ is $$34$$, the second digit must be $$4$$. Similarly, the third digit is $$6$$, since the only two-digit number in the two lists starting with a $$4$$ is $$46$$. However, the fourth digit can be $$8$$ or $$9$$, since there are two two-digit numbers, $$68$$ and $$69$$, in the two lists that start with a $$6$$. Now we need to consider two cases.

• Case 1: The fourth digit is an $$8$$.

Since the only two-digit number in the two lists starting with an $$8$$ is $$85$$, the fifth digit must then be $$5$$. Similarly, the sixth digit is $$1$$, and the seventh digit is $$7$$. We must stop here, since there is no two-digit number in either list that starts with a $$7$$. Therefore, the fourth digit must not be $$8$$.
• Case 2: The fourth digit is $$9$$.

Since the only two-digit number in the two lists starting with a $$9$$ is $$92$$, the fifth digit must then be $$2$$. Similarly, the sixth digit is $$3$$. We can now repeat our argument from the beginning. The digit after the $$3$$ must be a $$4$$, then a $$6$$, then a $$9$$, then a $$2$$. The five digits `$$34692$$’ will continue to repeat as long as a $$9$$ follows the $$6$$.

Since $$2022\div 5 = 404.4$$, the number of length $$2022$$ will consist of $$404$$ blocks of five digits followed by two more digits. As we saw above, the first $$403$$ blocks of digits must each be the five digits $$34692$$. However, the last seven digits could be $$3469234$$ or $$3468517$$.

Therefore, there are two possibilities for the last three digits. The last three digits could be $$234$$ or $$517$$.