0

Let $p, N$ be positive integers with $p$ divides $N$.

Why for every integer $X$, $[[X \bmod N] \bmod p ] = [X \bmod p ]$?
And how do I show that $[[X \bmod p ] \bmod N]$ need not equal $[X \bmod N]$?

Joffan
  • 39,627
Jjang
  • 133
  • For the first question, that is by definition. Think about what $a + bN$ is modulo $N$ and $p$. For the second, just find a counterexample. With small enough $p$ and $N$ you can simply look at all the possibilities and find one, e.g., try finding a counterexample with $p=2$ and $N=4$. – Alex Jan 20 '17 at 16:38
  • 1
    @Alex I suggest you turn your comment into an answer. I'm getting a mixed message from you saying "by definition" and also saying "think about it" so you might want to revise that in the process. – Joffan Jan 20 '17 at 16:43

1 Answers1

0

For the first question, that is by definition. What is $a + bN$ modulo $N$, and modulo $p$?

For the second, just find a counterexample. (If it's not true for a particular choice of $p$ and $N$, it's not true.) With small enough $p$ and $N$ you can simply look at all the possibilities and find one, e.g., try finding a counterexample with $p=2$ and $N=4$.

Alex
  • 4,108