Alternating Sign Sequence
JavaScript ES6, 18 bytes



n=&gt;-~(n/3)*(1-n%3)


Turned out very similar to @LeakyNun's answer but I didn't see his until after I posted mine.

Explanation and Ungolfed

-~ is shorthand for Math.ceil, or rounding up:

n =&gt;               // input in var `n`
    Math.ceil(n/3) // Get every 3rd number 1,1,1,2,2,2, etc.
    *
    (1-n%3)        // 1, 0, -1, 1, 0, -1, ...




function f(n){n=i.value;o.value=-~(n/3)*(1-n%3);}
Input: &lt;input id=i oninput="f()"/&gt;&lt;br /&gt;&lt;br /&gt;
Output: &lt;input id=o readable/&gt;