Confused101's blog

By Confused101, history, 8 years ago, In English

For any three integers is N / (x * y) same as N / x / y?

I tried to check for many random values, It comes out to be same. Is it true for any 3 integers N, x, y. How to prove it. Sorry if the question is silly.

Thanks!

  • Vote: I like it
  • +21
  • Vote: I do not like it

»
8 years ago, # |
Rev. 2   Vote: I like it -23 Vote: I do not like it

deleted

»
8 years ago, # |
  Vote: I like it +29 Vote: I do not like it

Are you looking for a case if it is floored every time after division?

  • »
    »
    8 years ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    Yes, "/" operator is integer division here, N, x, y are integers.

»
8 years ago, # |
  Vote: I like it +72 Vote: I do not like it

N = xy·k + r, for some k and r < xy.

.

Since r < xy, the answer always be equal to k regardless of an order of operations you choose.