A005132
Recamán’s sequence (or Recaman’s sequence): a(0) = 0; for n > 0, a(n) = a(n-1) - n if nonnegative and not already in the sequence, otherwise a(n) = a(n-1) + n.
offset: 0
codomain: ℕ
Declarations
Section titled “Declarations”- Recamancomputable