Hi,

I'm trying to solve this puzzle for a geocaching challenge:

AB + CD = EF

AG + CE = FH

BF - GE = AJ

A>C

Numbers to be used are 1 to 9

Thanks,

FoxEcho

Printable View

- Jun 10th 2010, 09:12 AMFoxEchoLetter / Number puzzle
Hi,

I'm trying to solve this puzzle for a geocaching challenge:

AB + CD = EF

AG + CE = FH

BF - GE = AJ

A>C

Numbers to be used are 1 to 9

Thanks,

FoxEcho - Jun 10th 2010, 09:13 AMUnknown008
Just a quick question, does AB mean A times B or a number with digits AB?

- Jun 10th 2010, 09:19 AMFoxEcho
AB is a number with digits AB,

and so on and so forth.

FE - Jun 10th 2010, 09:44 AMhungthinh92
- Jun 10th 2010, 09:45 AMUnknown008
I guess so, if it was not, the question wouldn't use different letters to represent the digits.

- Jun 10th 2010, 09:48 AMhungthinh92
- Jun 10th 2010, 09:48 AMFoxEcho
Yes, all numbers are different.

Numbers 1 to 9 are represented by letters A to J

(the letter I has not been used to avoid confusion with the number 1).

FE - Jun 10th 2010, 10:13 AMundefined
The lazy programmer's solution, in Java:

Code:`public class NumPuzz1 {`

public static void main(String[] args) {

long time=System.currentTimeMillis();

int a,b,c,d,e,f,g,h,j;

for(a=2;a<10;a++)

for(b=1;b<10;b++) if(b!=a)

for(c=1;c<a;c++) if(c!=b)

for(d=1;d<10;d++) if(d!=a && d!=b && d!=c)

for(e=1;e<10;e++) if(e!=a && e!=b && e!=c && e!=d)

for(f=1;f<10;f++) if(f!=a && f!=b && f!=c && f!=d && f!=e)

for(g=1;g<10;g++) if(g!=a && g!=b && g!=c && g!=d && g!=e && g!=f)

for(h=1;h<10;h++) if(h!=a && h!=b && h!=c && h!=d && h!=e && h!=f && h!=g)

for(j=1;j<10;j++) if(j!=a && j!=b && j!=c && j!=d && j!=e && j!=f && j!=g && j!=h)

if(10*a+b + 10*c+d == 10*e+f && 10*a+g + 10*c+e == 10*f+h && 10*b+f - (10*g+e) == 10*a+j)

System.out.println(a+","+b+","+c+","+d+","+e+","+f+","+g+","+h+","+j);

System.out.println("Elapsed: "+((System.currentTimeMillis()-time)/1000.0)+" seconds");

}

}

Code:`3,6,1,8,5,4,2,7,9`

Elapsed: 0.047 seconds

- Jun 10th 2010, 10:17 AMhungthinh92
- Jun 10th 2010, 10:19 AMFoxEcho
Wow! Thanks a lot!

If I have other puzzles like this (which I'm sure I'll have)

I'll post them here if you don't mind.

Merci,

FE - Jun 10th 2010, 10:21 AMWilmer
- Jun 10th 2010, 10:25 AMundefined
Yes A=3, B=6, etc. Figured I could omit that since it's the most natural way to list them out.

AB = 36

CD = 18

36 + 18 = 54, not 99...

That is a good point. I don't know what geocaching is, and thought it's just some puzzle for fun that doesn't really count for anything. - Jun 10th 2010, 10:29 AMDeadstar
I'm trying a non-computing approach.

Finding an ordering on them is easier. Reduces amount of possibilities.

Brb not looking at solution - Jun 10th 2010, 10:32 AMFoxEcho
Like he says, this is just for fun,

you can have all the help you want,

or none at all if you don't want any.

It's each and everyone's call.

Most of the times, when you're stuck on a puzzle,

the creator of the puzlle will guide you in the correct path,

if you ask him (and as the saying goes, it makes the puzzle creator

feel so much superior... ha ha ha)

Again,

thanks for the help!

FE