1

$m$ takes values from 1 to an even number $M$ and $k = M/2$. This expression ${(m+k-1 \text{ mod } k) + 1}$ gives the repeated sequence of numbers from 1 to k. How can I further simply the expression to give the same repeated sequence?

For example M = 24 the expression gives the sequence

1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12

Salwa
  • 67

1 Answers1

0

Obviously $k\equiv0\bmod k$, so in the end we get $(m-1)\bmod k+1$ (assuming the computing definition of $\bmod$).

Parcly Taxel
  • 103,344
  • $m \mod k$ gives 1 2 3 4 5 6 7 8 9 10 11 0 1 2 3 4 5 6 7 8 9 10 11 0. the values at m = 12 and 24 is zero not 12 – Salwa Jan 09 '21 at 04:29
  • $m-1 \mod k +1$ gives the same but I am not sure we can further simplify. – Salwa Jan 09 '21 at 04:35