There's always a huge formula for the triangle wave, or the "teeth" function as I like to call it. Shouldn't this give a teeth function too? It's sorta hard to understand, but once you get the hang of it, it works out fine. This one produces $(-2,2), (0,0), (2,2), (4,0)$, etc.
$f(x) = |x-4k|$, where $4k-2 \leq x \leq 4k+2$ and $k$ is an integer. Plug in different $k$ values $(0, 1, 2, etc)$