# Thread: Letter / Number puzzle

1. ## Letter / 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

2. Just a quick question, does AB mean A times B or a number with digits AB?

3. AB is a number with digits AB,
and so on and so forth.

FE

4. Originally Posted by FoxEcho
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
Do they need to be different. I mean A≠b≠C

5. I guess so, if it was not, the question wouldn't use different letters to represent the digits.

6. Originally Posted by Unknown008
I guess so, if it was not, the question wouldn't use different letters to represent the digits.
Ommm silly me! I just ate lunch, so my brain starts working again

7. 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

8. 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");
}
}
Output:

Code:
3,6,1,8,5,4,2,7,9
Elapsed: 0.047 seconds

9. Originally Posted by undefined
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");
}
}
Output:

Code:
3,6,1,8,5,4,2,7,9
Elapsed: 0.047 seconds
what is A, B, C, D...?
If A=3 B=6...
then AB+CD = 99 :| i'm sorry
You forgot they are different. But still that's nice programming

10. 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

11. Originally Posted by FoxEcho
I'm trying to solve this puzzle for a geocaching challenge:
Aren't those competitions, thus illegal for you to get help?

12. Originally Posted by hungthinh92
what is A, B, C, D...?
If A=3 B=6...
then AB+CD = 99 :| i'm sorry
You forgot they are different. But still that's nice programming
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...

Originally Posted by Wilmer
Aren't those competitions, thus illegal for you to get help?
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.

13. I'm trying a non-computing approach.

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

Brb not looking at solution

14. Like he says, this is just for fun,
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

### letters to number puzzle solvers d

Click on a term to search for related topics.