Return the `n`th term of the Recamán's sequence.
```
a(0) = 0;
        a(n-1) - n, if this value is positive and not yet in the sequence
      /
a(n) <
      \
        a(n-1) + n, otherwise
```
___
A video about Recamán's sequence by Numberphile: https://www.youtube.com/watch?v=FGC5TdIiT9U
def recaman(n):
    series, last = {0}, 0
    for i in range(1, n+1): 
        test = last - i
        last = last + i if test < 0 or test in series else test
        series.add(last)     

    return last
def recaman(n):
    series, last = {0}, 0
    for i in range(1, n+1): 
        test = last - i
        last = last + i if test < 0 or test in series else test
        series.add(last)     

    return last