BAMO 2008 Problem 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.