This problem is easy, I provide it just for fun of the community.
Like many other mad scientists, I believe that time travel is possible. One of such possibilities was described by a Soviet, Ukrainian, and Israeli writer Felix Krivin. I quote his novel “I’ve Stolen the Time Machine”:
Time Machine was stolen again....
This happened at the height of the celebration of a new year $4119$. Thus, taking into accounts technical possibilities of modern machines, the criminal could jump to years: $1149$, $1194$, $1419$, $1491$, $1914$, $1941$, $4191$, $4911$, $9114$, $9141$, and $9411$.
This clearly suggests a pattern of possible jumps in time. It is easy to check that this pattern allows to a time traveler (for instance, to Emmett "Doc" Brown), starting from any year in a range from $0001$ to $9998$, to reach any other year in the range, provided he will live sufficiently long. Indeed, the traveler can live up to $9998$, then jump to $8999$, live up to $9000$, jump to $0009$, live up to $0010$, and jump to the beginning of the new history. From the beginning Doc can live up to the needed year. Since, looking for a shortest path he can avoid entering any year twice, he would achieve the destination year if he would be one of Far Eastern emperors, according to regular wishes of banzai to them. This task may be a challenge even to Methuselah, who, according to Bible, lived $969$ years [Gen. 5:27]. But I’m more interested in possibilities of mere mortals. So, my question is:
How many years to live suffices in order to reach any year in the given range from any other year in the range?
“The Path of Time” by Jean-Paul Avisse