3
$\begingroup$

When $1200$ is divided by $N$ and $N+x$, the remainder in both cases is $35$.

What is the maximum value of x?

  • 2
    martin, Yes I am new to this site. This question *sounds* homework like but it is not. I am preparing for a competitive exam, and so, I asked this because I didn't know , what is the correct way to do this problem. I accept your code-of-conduct and conditions very truthfully and I promise, I will try to show my work, so that it does not sound like a homework question. Thanks.2012-09-22

3 Answers 3

5

What can we say about $1200-35=1165$ in relation to $N$ and $N+x$? Particularly with regards to divisibility.

Hint 2: Look at all factors of $1165$, see what you can say.

2

When 1200 is divided by any number greater than 1200 remainder is 1200. When 1200 is divided by (1200-35)=1165 remainder is 35. Again when 1200 is divided by 233 remainder is 35.So greatest value of x is 1165-233=932

  • 1
    Depending on the competition, that is not sufficient. You've shown that x=932 is a possible value of x, but how can you show that it's the maximum?2012-09-22
-1

I will use Haskell to brute-force this problem. Here's an extremely brief GHCi session:

Prelude> [ n | n <- [1..1200], 1200 `mod` n == 35] [233,1165] 

Because $1200 = (233 \times 5) + 35 = 1165 + 35$. Since $1165-233 = 932$, we have $x = 932$. Alternatively, we could have used a sexier list comprehension, as follows:

Prelude> [ x | n <- [1..1200], x <- [1..(1200-n)], 1200 `mod` n == 35, 1200 `mod` (n+x) == 35] [932] 

The interpretation of these "experimental" results is left to the reader.