Cryptograms (Problem 2)

Algebra Level 1

R G B R G B + R G B G G G \large{\begin{array}{ccccccc} & R& G&B \\ & R& G&B\\ + & R& G&B\\ \hline & G & G&G \end{array}}

Solve for G G G \overline{GGG} .

Note: B , G , R B, G, R are different non-zero digits.


The answer is 444.

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.

4 solutions

Mahdi Raza
May 13, 2020

*Can be (and should be solved using number theory), but i tried to hard code it, since i am learning to code :) *

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#Initialise
r = 0
g = 0
b = 0

#Actual code
for r in range(9):
    for g in range(9):
        for b in range(9):
            if (300*r + 30*g + 3*b == 111*g):
                print(r,g,b)

1
2
0 0 0
1 4 8

000 does not constitute distinct non-zero digits. Thus answer will be G G G = 444 GGG = \boxed{444}

@Mahdi Raza , it's different non-zero digits, therefore 000 000 wouldn't work as it violates both conditions.

Log in to reply

I know, thus answer is 444

Mahdi Raza - 1 year ago

Oops! Sorry for bothering you, @Mahdi Raza .

Richard Desper
May 13, 2020

There are many ways to do this problem.

One way is to simply iterate through values of B B . There are only ten possibilities, and each forces a unique value of G 3 B m o d 10 G \equiv 3B \mod 10 . One can then test to see whether this value of G G creates a contradiction in the tens' column.

For all of the following, I try each value of B B and let G = 3 B m o d 10 G = 3B \mod 10 .

Starting with B = 1 , G = 3 B = 1, G = 3 ? This choice fails in the tens column because 3 G = 9 ≢ 3 m o d 10 3G = 9 \not\equiv 3 \mod 10

Next, B = 2 , G = 6 B = 2, G = 6 ? Fails because 3 G = 18 ≢ 6 m o d 10 3G = 18 \not\equiv 6 \mod 10

And B = 3 , G = 9 B = 3, G = 9 ? Fails because 3 G = 27 ≢ 9 m o d 10 3G = 27 \not\equiv 9 \mod 10

Next, B = 4 , G = 6 B = 4, G = 6 ? Note that we'll start to need to carry the excess from the ones' column to the sum in the tens column. In this case, it fails because 3 G + 1 = 19 ≢ 6 m o d 10 3G + 1 = 19 \not\equiv 6 \mod 10

B = 5 , G = 5 B = 5, G = 5 ? Fails because B = G B=G , which isn't allowed.

B = 6 , G = 8 B = 6, G = 8 ? Fails because 3 G + 1 = 25 ≢ 8 m o d 10 3G + 1 = 25 \not\equiv 8 \mod 10

B = 7 , G = 1 B = 7, G = 1 ? Fails because 3 G + 2 = 5 ≢ 1 m o d 10 3G + 2 = 5 \not\equiv 1 \mod 10

B = 8 , G = 4 B = 8, G = 4 ? Then 3 G + 2 = 24 4 m o d 10 3G + 2 = 24 \equiv 4 \mod 10 . We then consider the hundreds column to find R R : 3 R + 1 = 4 3R + 1 =4 means R = 1 R = 1 .

So R = 1 , G = 4 , B = 8 R = 1, G = 4, B = 8 is a solution.

Just for sake of completeness, if B = 9 , 3 B = 27 B = 9, 3B = 27 , so G = 7 G = 7 . But 3 G + 2 = 23 ≢ 7 m o d 10 3G + 2 = 23 \not\equiv 7 \mod 10 .

So ( R , G , B ) = ( 1 , 4 , 8 ) (R,G,B) = (1,4,8) is the only solution.

Nice use of modulo, @Richard Desper !

Since R 1 R\geq 1 , therefore G 3 G\geq 3 .

R = 1 , G = 4 , B = 8 , G G G = 444 R=1,G=4,B=8, \overline {GGG}=\boxed {444}

In your second solution you have G = 9 G=9 and G = 8 G=8 .

Chris Lewis - 1 year ago

Log in to reply

Oh! Great mistake!!

@Alak Bhattacharya , you have G = 9 G = 9 and G = 8 G = 8 . How's that possible?

@Alak Bhattacharya : 2 9 6 2 9 6 + 2 9 6 8 8 8 \large{\begin{array}{ccccccc} & 2& 9&6 \\ & 2& 9&6\\ + & 2& 9&6\\ \hline & 8 & 8&8 \end{array}}

1 4 8 1 4 8 + 1 4 8 4 4 4 \large{\begin{array}{ccccccc} & 1& 4&8 \\ & 1& 4&8\\ + & 1& 4&8\\ \hline & 4 & 4&4 \end{array}}

Where B = 8 , G = 4 , R = 1 B = 8, G = 4, R = 1

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...