a) Let us show that the nearest sequence of 7 colored years is 2103,…,2109. First, we prove that in this century no sequence of more than six colored years can happen any longer. We see that digits 0 and 2 cannot represent units or tens. Therefore, a chain is broken at each year ending in 0 or 2, which gives us the only way to form a chain of 7 years:
20∗3,20∗4,…,20∗9.
Here, ∗ can only be equal to 1, but this is the current chain. In the next century, after 2100, the first chain is easy to find: 2103,…,2109.
b) Years we deal with are written with at least four digits. A colored chain cannot contain numbers ending in 99, hence the number of hundreds doesn't change throughout the chain. This implies that there are only 8 possible last digits.
Assume some colored chain has 8 numbers. We have two cases.
1. All years have the same number of tens. Then there are only 7 options for the last digit. Contradiction.
2. The number of tens changes within the chain. In this case the tens digit cannot be equal to 9. Assume this digit changes from x to x+1. The chain has 8 numbers, thus, it should have two numbers of the type
abx+x+1,abx+1x.
For example, they might be 2145 and 2154. But then the chain has at least 10 years (for example, 2145 to 2154). Again, we have a contradiction.