What do we know about a % b % c?

41 Views Asked by At

That is, what can we say about chained application of the modulo operation?

E.g., are there any theorems for certain values of a,b, and c s.t. (a % b % c) == (a % bc), or something similar?

The only thing I can think of is, given $0 < a < b < c: a \% b \% c = a$.

1

There are 1 best solutions below

2
On

The operation is not associative, i.e., $$a \%(b\%c) \neq (a \%b)\%c$$ Hence, you first need to specify which one you are after $a \%(b\%c)$ or $(a \%b)\%c$