Modulo arithmetic a = 1 mod n

3.1k Views Asked by At

If I know value of $a$ and also it is known that $$a \equiv 1 \pmod n$$ how can I calculate value of $n$?

2

There are 2 best solutions below

5
On BEST ANSWER

To explain the comment above:

$$a = 1 \mod n$$ $$\iff a = 1 + k \cdot n$$ $$\iff a - 1 = k \cdot n$$ $$\iff n = \frac{a-1}{k}$$

... and $n$ should be an integer, shouldn't it?

1
On

Take for example, $15 = 27$ $mod$ $4$. What this basically means is that $15$ and $27$ both leave the same remainder when divided by $4$, that is 3. In that sense they are equal. They also leave the same remainder $1$ when divided by $2$, so therefore $15=27$ $mod$ $2$. Can you figure out now the relation between $a$ and $n$?