0

When creating a formula I used the "modulo operation" more than once. I then got something like this:

x mod n mod m ,

for positive integers x,m and n. Is there any way to simplify this? It seems probable to me but I couldn't find any so far.

user34
  • 5
  • 2
    Could you include some more details about how you got your repeated modulo operation? – Sebastian Monnet Feb 17 '22 at 16:09
  • 1
    By the way, you should write your questions using MathJax. Here's a tutorial: https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference – Sebastian Monnet Feb 17 '22 at 16:10
  • Context would help. What specific formula did you create? Is it something like

    $62\pmod 7 \pmod 5 =1?$

    – poetasis Feb 17 '22 at 16:16
  • In this case I have something like this: $$\lfloor x/3^j \rfloor \bmod 3 \bmod 2$$ – user34 Feb 17 '22 at 16:20
  • In general it only simplifies when $,m\mid n,,$ where it equals $,x\bmod m,, $ see here – Bill Dubuque Feb 17 '22 at 16:20
  • ahh, ok, so in this case there is no way to write it differently? – user34 Feb 17 '22 at 16:22
  • Yes, generally you can't simplify it further unless $,m\mid n.,$ It may not even be well-defined depending on the context. – Bill Dubuque Feb 17 '22 at 16:23
  • ok then thank you very much! As I am new here: should I, now that I know the answer to my question, close this thread in any way? – user34 Feb 17 '22 at 16:25
  • @user34 As a new user, you are fine, but the older users have messed up. Ideally, they should have answered the question in an answer rather than in comments, and then you could accept that answer. – Misha Lavrov Feb 17 '22 at 17:44

1 Answers1

0

If you are only interested in the ($x$ mod $3$) mod $2$ case, then you could use

$$2(x\text {mod} 3)-(x\text {mod} 3)^2.$$

This may (or may not!) be easier for whatever calculations you have to carry out.