Solution (source code)

= Solution

The first three subtractions are negative or return the already-seen zero, so addition is used. The fourth subtraction gives a new positive two; the next subtraction is negative. Thus \b[$r(1),\ldots,r(5)=1,3,6,2,7$]. These are the initial terms of <Recamán's sequence>.<OEIS entry A005132>[Initial terms, offset zero]{ref}