There's gold in there!

You are trying to take out pieces of gold from a treasure chest.

If you remove gold pieces 3 at a time, then 2 pieces are leftover.
If you remove gold pieces 4 at a time, then 3 pieces are leftover.
If you remove gold pieces 5 at a time, then 4 pieces are leftover.

What's the smallest possible number of gold pieces in the chest?


The answer is 59.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

8 solutions

Imrul Khan
Oct 1, 2015

Let's think simple, look at the facts.

If x is the number of gold pieces in the treasure chest, then x+1 must be divisible by 3,4,5.

Because we require smallest possible number of gold pieces, x+1 should be equal to the least common multiplier (LCM) of 3,4,5 which is 60. So, the smallest possible number of gold pieces in the chest would be x=59

Chew-Seong Cheong
Sep 30, 2015

Let the number required be n n , then by Chinese Remainder Theorem , we have:

n 2 ( m o d 3 ) n = 2 + 3 t where t is an positive integer 2 + 3 t 3 ( m o d 4 ) 3 t 1 ( m o d 4 ) t 3 ( m o d 4 ) t = 3 + 4 x n = 2 + 3 t = 2 + 3 ( 3 + 4 x ) = 11 + 12 x 11 + 12 x 4 ( m o d 5 ) 2 x 3 ( m o d 5 ) x 4 ( m o d 5 ) x = 4 + 5 y n = 11 + 12 x = 11 + 12 ( 4 + 5 y ) = 59 + 60 y \begin{aligned} n & \equiv 2 \pmod{3} \\ \Rightarrow n & = 2 + 3\color{#3D99F6}{t} \quad \quad \quad \quad \color{#3D99F6}{\text{where }t \text{ is an positive integer}} \\ 2 + 3t & \equiv 3 \pmod{4} \\ 3t & \equiv 1 \pmod{4} \\ t & \equiv 3 \pmod{4} \\ \Rightarrow t & = 3 + 4x \\ \Rightarrow n & = 2+3t = 2 + 3(3+4x) = 11+12x \\ 11 + 12x & \equiv 4 \pmod{5} \\ 2x & \equiv 3 \pmod{5} \\ x & \equiv 4 \pmod{5} \\ \Rightarrow x & = 4 + 5y \\ \Rightarrow n & = 11+12x = 11 + 12(4+5y) = 59 + 60y \end{aligned}

\Rightarrow the smallest n = 59 + 60 ( 0 ) = 59 n = 59+60(0) = \boxed{59}

Adhiraj Dutta
Apr 15, 2020
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#include<iostream>
int main()
{ for (int i=1; i<200; ++i)
{
    if (i%3==2)
        {
            if (i%4==3)
                {
                  if (i%5==4)
                    { std::cout<<i<<"\n";
                    }
                 }
          }
}
return 0;
}

59

119

179

This is an AP with common difference 60 60 .

You need a number that's not the product of 2 of the given number

The cycle of 5 fluctuates between 0 and 5; so the number would be X4 or X9

But the cycle of 4 fluctuates between 0,2,4,6,8, so we will eleminate X4 and it'll be X9

So for 3 we need X7,for 4 X6,for 5 X5

The cycle of 3 repeates every 30, and X7 appears at cycle end

So first we try 29

3 .. valid as 27 less by 2

But 4 not valid as 28 is less by 1

Ok now try 59

3 .. valid as 57=3×19 less by 2

4 . .valid as 56=4×14 less by 3

Great way!

Adhiraj Dutta - 1 year, 2 months ago
Lewis Yeung
Oct 1, 2015

Let x be the smallest possible number of gold pieces in the chest

The question states the following (in simplified terms):

  • x mod 3 = 2
  • x mod 4 = 3
  • x mod 5 = 4

Since x mod 5 = 4, the units digit of x must be a 4 or 9 , as a multiple of 5 + 4 will always have its units digit 4 or 9

x also must be odd, as x mod 4 = 3. This means that x is equal to a multiple of 4 + 3 , which is equal to Even + Odd , which in turn is Odd . Therefore, the units digit of x must be 9

Then possible values of x (has units digit of 9) are all checked to ensure that it satisfies the equation x mod 3 = 2, and we see that the lowest possible value for x is 59 (other lower values are a multiple of 3, or has a remainder of 1 when divided by 3)

Therefore x = 59 \boxed{59}

Eli Ross Staff
Sep 30, 2015

The information about 2s is already true given the information about 4s, so we know the number of stones must be in the form 4 n + 3. 4n+3. (3 more than a multiple of 4.)

When we group this into 3's, we can make n + 1 n+1 complete groups, with n n left over -- so n n must be of the form 3 m + 2 3m+2 (2 more than a multiple of 3), so the total number of stones is 4 ( 3 m + 2 ) + 3 = 12 m + 11 4(3m+2)+3 = 12m + 11 .

We could continue this logic for 5s, but it is easy enough to check m = 1 , 2 , m=1,2,\ldots and see that m = 4 m=4 gives 59 stones, which leaves 4 left over when grouped into 5s! So 59 is the fewest number of stones needed.

If you'd like to learn a more "methodical" way to approach these problems, check out the Chinese Remainder Theorem ! In fact, using this method, we can quickly get the answer, since CRT says that the number must leave a remainder of ( 1 ) 3 = 1 (-1)^3=-1 when divided by 3 4 5 = 60. 3\cdot 4\cdot 5=60.

Daniel Yang
Oct 3, 2015

x=-1 (mod 3) x=-1(mod 4) x=-1(mod 5) x=-1 (mod 3 4 5) (because they are relatively prime) 59

LCM of 3,4&5 minus 1, That is 60 - 1 = 59

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...