Skip to main content
2 of 6
saved 1 byte
Arnauld
  • 197.6k
  • 20
  • 179
  • 650

JavaScript (ES6), 26 bytes

Returns the \$n\$-th term of the sequence. Relies on arithmetic underflow to stop the recursion.

f=n=>n?(-n%4/3|1)*f(n/2):1

Try it online!

Arnauld
  • 197.6k
  • 20
  • 179
  • 650