# How to write modular notation?

How do we write modular notation? I have searched but other answers do not satisfy. Yes N = 1 (mod 2) means N mod 2 is 1.

But how do I write ((N mod (K +1)) - 1) in a formal paper? I want to write steps and use a variable. For example: To win, use P numbers in the game. Where, P = ((N mod (K +1)) - 1)

• Is there any problem writing $P = (N \text{ mod } (K+1)) - 1$? – Sangchul Lee Feb 7 at 3:27
• Can you clarify your statement question, and also use MathJax(i.e. LaTeX) if possible? – Max0815 Feb 7 at 3:34
• It is more usual to write N \equiv 1 \mod 2 or N\equiv 1 \pmod 2 .That is, $N\equiv 1 \mod 2$ or $N\equiv 1 \pmod 2,$ reserving the Equals sign only for things that are, in fact, equal. – DanielWainfleet Feb 7 at 4:46

On second thought - there are two different things that get called "mod".

One is an equivalence relation; grammatically, we treat it as an adverb modifying the equals sign. In this form, no further arithmetic "outside" the mod is allowed, because in principle it applies to the whole equation. If you are using this, what you wrote is formally incorrect.

The other is an operation, the remainder after integer division. It's common in programming, often with the % sign in code. In this case, the remainder $$(N\mod K+1)$$ will specifically be between $$0$$ and $$K$$, the representative of the equivalence class in that range. Well, usually. Some programming languages will flip this to the range from $$-K$$ to $$0$$ for negative $$N$$.
I should also note that your specific example is problematic here, too - what happens if that remainder is zero? How can you use $$-1$$ numbers in the game?

If you're going to use that operation, you need to clarify what you're doing, in words. See here for more on that subject.

• No, here $\bmod$ denotes an operation. You are confusing it with the equivalence relation of congruence. – Bill Dubuque Feb 7 at 4:03
• No confusion. I'm refusing to accept the validity of it as an operation. – jmerry Feb 7 at 4:06
• What does it mean for a well-defined (and widely used) operation to be "invalid"? – Bill Dubuque Feb 7 at 4:07
• On second thought - answer completely rewritten. – jmerry Feb 7 at 4:24