Question: Note: I'm assuming all operators below are left-associative.  

`a - b - c` is equal to `a - (b + c)`.  

`a / b / c` is equal to `a / (b * c)`.

Are there any similar equivalences for the modulo operator?  

I've figured that `a % b % c` is equal to `a % b` if `b <= c` and `a % c` if `b > c && b % c == 0`. However, I can't figure out what `a % b % c` equals when `b > c && b % c != 0`. Is there a more general or elegant way to think about chained modulo operators? Additionally, can you think of any algorithms or usages of chained modulo operators of the last type?

Answer: 
Let's take `b = q0*c + r0`

You decompose

```
a  = q1 * b + r1
r1 = q2 * c + r2

a = q1 * (q0 * c + r0) + q2 * c + r2

a = (q1 * q0 + q2) * c + q1 * r0 + r2  

```

So you can say that

```
r2 = (a - q1 * r0) % c

```

Or in other words

```
(a%b%c) = (a - (a/b)*(b%c)) % c

```

This also works when `b<c`, because `(a - (a/b)*b)` is just `a%b`

But I doubt that this is very usefull
Chained modulo operators have no particular meaning in general, and the result may actually be ill-defined.

If you think of modulo p as a *projection* from integral numbers to some set `{k, ... k + p - 1}` then chaining two projections may not be clearly defined mathematically since the chaining depends on the choice of `k` (more precisely, chaining `% p` and `% q` depends on `k % q`).

To take this to the programming world, note that the C standard mandates that the sign of `a % b` is implementation defined when `a` is not positive.

As an example: `-1 % 3` may be `-1` or `2` depending on the implementation. Then, `(-1 % 3) % 2` may be `0`, `1`, or `-1` one depending on the implementation...