Let's see if we have a repetitive pattern
Beginning number Ending number
5 14
14 7
7 20
10 5
5 14 ........
Note that the cycle starts over after every 4 steps
After pressing the button 1000 times (since 1000 is divisible by 4) we are back at 5
Pressing the button on the 1001th time will display 5*3 - 1 = 14