1 Call a year ultra-even if all of its digits are even. Thus $2000,2002,2004,2006$, and 2008 are all ultra-even years. They are all 2 years apart, which is the shortest possible gap. 2009 is not an ultra-even year because of the 9 , and 2010 is not an ultra-even year because of the 1 .
(a) In the years between the years 1 and 10000 , what is the longest possible gap between two ultra-even years? Give an example of two ultra-even years that far apart with no ultra-even years between them. Justify your answer.
(b) What is the second-shortest possible gap (that is, the shortest gap longer than 2 years) between two ultra-even years? Again, give an example, and justify your answer.
Solution:
(a) The longest possible gap has length 1112. There are four valid examples of two ultra-even years that far apart with no ultra-even years between them: 888 to 2000,2888 to 4000,4888 to 6000 or 6888 to 8000 . ( 8888 to 10000 is not acceptable as 10000 is not ultra-even).
To see that no longer gap is possible, note that if $A$ and $B$ are ulta-even years between 1 and 10000 with no ulta-even year between them, and $B-A \geq 1000$, then $A$ and $B$ must have different digits in their "thousands place". Since both of these digits must be even, that means there must be at least one odd digit $d$ in between them, and so all the years between $d 000$ and $d 999$ must be in the gap between $A$ and $B$. But the smallest ultra-even year greater than $d 999$ is $e 000$ (where $e=d+1$, of course), and the largest ultra-even year less than $d 000$ is $c 888$ (where $c=d-1$ ), so this gap must be of length exactly 1112 .
Another approach is to consider the increasing sequence of ulta-even years: 2 (the smallest ultra-even year), $888,2000,2888,4000,6000,6888,8000,8888$ (the largest ultra-even year less than 10000). Every ultraeven year is either in this sequence or lies between two elements of this sequence, so any two ultra-even years with no ultra-even years between them must have a difference that is less than or equal to a difference between two consecutive elements of this set; but the largest such difference is 1112 .
(b) The second-shortest possible gap is 12. Examples include 8 to 20,4268 to 4280 , etc
To see that this really is the second-shortest possible gap, note that every gap must be even, since the difference between any two ultra-even years is even. There are certainly many gaps of length 2 . (from 4022 to 4024 , for example). We must show that there are no gaps with lengths $4,6,8$, or 10 . Any ultra-even year whose UNITS digit is $0,2,4$, or 6 is 2 less than another ulta-even year (since adding 2 to this year won't change any other digit). So if an ultra-even year is the lower year of a gap longer than 2 years, its units digit must be 8 . However, if year $\mathrm{A}$ is ultra-even, and has a units digit of 8 , adding $2,4,6,8$, or 10 to it will result in a year whose ten digit is one greater than the ten digit of year $\mathrm{A}$, which will mean the new number is not ultra-even. So 12 is the smallest possible value for the gap between such years $\mathrm{A}$ and the next largest ultra-even number.