BrainDen.com - Brain Teasers
• 0

# Help! A remainder is chasing me

## Question

I just found a number with an interesting property:

When I divide it by 2, the remainder is 1.

When I divide it by 3, the remainder is 2.

When I divide it by 4, the remainder is 3.

When I divide it by 5, the remainder is 4.

When I divide it by 6, the remainder is 5.

When I divide it by 7, the remainder is 6.

When I divide it by 8, the remainder is 7.

When I divide it by 9, the remainder is 8.

When I divide it by 10, the remainder is 9.

It's not a small number, but it's not really big, either.

When I looked for a smaller number with this property I couldn't find one.

Can you find it?

## 67 answers to this question

• 0

Great riddle, very close to the Chinese remainder theorem,

Here's my brute force code for original riddle:

```
int remainder = 1;

string result = string.Empty;

for (int number = 1; number <= 10000; number++)

{

for (int divisor = 2; divisor <= 10; divisor++)

{

if (number % divisor == remainder)

{

if (remainder == 9)

{

break;

}

remainder++;

}

}

remainder = 1;

}

```
Code for the second riddle:
```
string result2 = string.Empty;

for (int number = 11; number <= 100000; number++)

{

for (int divisor = 2; divisor <= 10; divisor++)

{

if (number % divisor == 1)

{

if (divisor == 10)

{

++divisor;

if (number % divisor == 0)

{

result2 += string.Format("{0} ", number);

break;

}

}

}

else break;

}

}

```

##### Share on other sites
• 0

There is a perfect solution.

Study the question inteligently. Assume that answer is X. If you add 1 to the answer X = Say X+1 this figur will be the exact divisible by each number from 1 to 10.

Therefore you need to find a LCM Lowest common Multiple of numbers 1 to 10. That is 2520.

Pramod Kasarekar

Edited by kasarekar

##### Share on other sites
• 0

Ohw, I thought it was much easier.

Is this possible?

x² - x

Because:

2² - 2 = 4 - 2 = 2 --> 2/2 = 1

3² - 3 = 9 - 3 = 6 --> 6/3 = 2

4² - 4 = 16 - 4 = 12 --> 12/4 = 3

5² - 5 = 25 - 5 = 20 --> 20/5 = 4

6² - 6 = 36 - 6 = 30 --> 30/6 = 5

7² - 7 = 49 - 7 = 42 --> 42/7 = 6

8² - 8 = 64 - 8 = 56 --> 56/8 = 7

9² - 9 = 81 - 9 = 72 --> 72/9 = 8

10² - 10 = 100 - 10 = 90 --> 90/10 = 9

You see?

Or wasn't that the question?

##### Share on other sites
• 0

no i think u have misunderstood the question... u answered it thinking that remainder means the quotient (the actual answer) we are asking for the remainder

for instance lets say u have 5/2 the answer would = to 2 and the remainder would be 1 (speaking in long division way and without continuing to turn it into a decimal)

so the question was what is the smallest number you can get that when u divide it by 2 your remainder is 1 and when u divide by 3 your remainder is 2 and so on and so on...

no one could find anyth smaller.(but clever job on your answer were that the objective )hope that clears everything up

Edited by guppy

##### Share on other sites
• 0

i have the best method

since all the remainders differ by 1 from the divisors so.

.. let us assume the number to by x

so adding one to x ie x+1 results another number of special property.

ie it is divisible by all other numbers 2,3,4,5,6,7,8,9,10.

to find the least number taking their LCM(lowest common multiple) results you 2520 yes

x+1=2520

so x is equal to 2519

i can assure you no other method is better

Edited by harikrishnan

##### Share on other sites
• 0

i have the best method

since all the remainders differ by 1 from the divisors so.

.. let us assume the number to by x

so adding one to x ie x+1 results another number of special property.

ie it is divisible by all other numbers 2,3,4,5,6,7,8,9,10.

to find the least number taking their LCM(lowest common multiple) results you 2520 yes

x+1=2520

so x is equal to 2519

i can assure you no other method is better

##### Share on other sites
• 0

Love it! Great problem

• 0

29, i guess?

##### Share on other sites
• 0

2519

Lets say the number is X.

SInce, it is divisible by the numbers 2,3,...,10, if we add 1 to it.

SO, the number (X+1) is divisible by 2,3,4,...,10.

Now, we need to find the smallest number divisible by 2,3,4,...,10.

It should be the LCM(2,3,4,...,10) = 2520

So, X+1 = 2520

hence, X = 2519

##### Share on other sites
• 0

the smallest we can find is 2519

##### Share on other sites
• 0

surely the correct answer on my account would be ... NO

##### Share on other sites
• 0

i think 839 is a smaller solution to the problem

##### Share on other sites
• 0

if you check out each number out each number's posiblities and put it into a formula, you will obtain:

for the number 2: (x is any natural number, and it's diferent for every equation)

1+ 2x

Number 3

29+30x

Number 4

19+ 20x

Number 5

9+ 10x

Number 6

29 + 30x

Number 7

69 + 70x

Number 8

39 + 40x

Number 9

89+90x

Number 10

9 + 10X

So we need a number that is equivalent to all those equations. we have:

1+2X

29+30X

19+20X

9+10X

69+70X

39+40x

89+90X

So, we go and analyse the equations who give bigger products for the smallest number of X. those are: 89+90x and 69 + 70x. Replacing one of the x for another letter (y) we get:

89+90y = 69 + 70x <=> 20 = 70x - 90y

With that, we can now replace the "x" and the "y". for that formula to work, after some calculations, I notice that the x must go for 8 + 9z and the y must go 6+7z

So, starting for the 1st, if z = 0, x=8 and y=6. we replace them in the equation

89 + 90 x 6 = 629.

However, this number doesnt exist on the equation 39+40x, so its invalid.

You keep going,

z=1; x= 17 and y = 13, the final =1259, also doesnt exist on the equation 39+40x, so its invalid.

z=2, the final is 1889, also invalid.

Then, finally, z=43 y = 6+(7x3) =27........ 89 + 90x27 = 2519; which is valid for all the equations.

##### Share on other sites
• 0

I actually believe I've found a smaller number, if negative numbers are allowed.

-1 !

-1 = -1 * 10 + 9

-1 = -1 * 9 + 8

-1 = -1 * 8 + 7

-1 = -1 * 7 + 6

-1 = -1 * 6 + 5

-1 = -1 * 5 + 4

-1 = -1 * 4 + 3

-1 = -1 * 3 + 2

-1 = -1 * 2 + 1

##### Share on other sites
• 0

For those of those familiar with SQL, these types of problems are easily solved by perfoming a query on a Numbers (or Tally) table.

For example I have run the following selection on a numbers table (Numbers) containing 100,000,000 Rows (1,2,3....100,000,000) for the first 17 rows of the sequence (2 remainer 1 up to 18 remaining 17)

SELECT

Min(Number)

FroM Numbers

WHERE

Number%2 = 1

AND Number%3 = 2

AND Number%4 = 3

AND Number%5 = 4

AND Number%6 = 5

AND Number%7 = 6

AND Number%8 = 7

AND Number%9 = 8

AND Number%10 =9

AND Number%11 = 10

AND Number%12 = 11

AND Number%13 = 12

AND Number%14 = 13

AND Number%15 = 14

AND Number%16 = 15

AND Number%17 = 16

AND Number%18 = 17

(To get the solutions to next rows in the sequence: 19 remainder 18, 20 remainder 19...) requires a bigger Number table

Edited by brifri238

##### Share on other sites
• 0

FYI: If you extend the sequence from 2 remainder 1 .... to bigger numbers

possible solutions are (I am not absoutely sure they are the smallest number that works for each but these work!)

20 remainder 19 ......................232,792,559

22 remainder 21.......................232,792,559

23 remainder 22....................5,354,228,879

24 remainder 23....................5,354,228,879

30 remainder 29.............2,329,089,562,799

31 remainder 30...........72,201,776,446,799

36 remainder 35.........144,403,552,893,599

40 remainder 39......5,342,931,457,063,199

Edited by brifri238

##### Share on other sites
• 0

i think 839 is a smaller solution to the problem

839 / 9 has a remainder of 2, when it's supposed to be 8, so 839 isn't a solution.

## Create an account

Register a new account