Tuesday, January 5, 2010

Baffling Numbers

---T --W--E--L--V--E

---T--W--E--L--V--E

---T--W--E--L--V--E

---T--W--E--L--V--E

---T--W--E--L--V--E

-+-T--H--I--R--T--Y

________________

---N--I--N--E--T--Y



Each letter in the sum above represents a different digit. Can you crack the code?

10 Comments:

Anonymous Knightmare said...

i worked on this for like an hour,had a nap, and hoped someone else would do it.

t=1 (or 0)
e=2 or 0
that's as far as i can muster

January 5, 2010 10:26 PM  
Blogger Ragknot said...

Twelve --- Thirty --- Ninty
120640 --- 133815 --- 737015
120640 --- 133819 --- 737019
130720 --- 194415 --- 848015
130720 --- 194416 --- 848016
130760 --- 194215 --- 848015
140960 --- 133215 --- 838015
140960 --- 133217 --- 838017

January 6, 2010 12:32 AM  
Blogger Ragknot said...

Let's try again

Twelve = 130760
Thirty = 194215
Ninety = 848015

January 6, 2010 1:19 AM  
Anonymous Zaux said...

No more calls please ... we have a winner --> Ragknot

January 6, 2010 11:52 AM  
Blogger Ragknot said...

That was good, Do you have another like that?

January 6, 2010 1:29 PM  
Blogger Chris said...

Hi Ragknot. How did you do it? If with code, could you post it? Thanks.

January 6, 2010 7:32 PM  
Blogger Ragknot said...

This post has been removed by the author.

January 7, 2010 1:53 PM  
Blogger Ragknot said...

This post has been removed by the author.

January 7, 2010 1:56 PM  
Blogger Ragknot said...

This post has been removed by the author.

January 7, 2010 2:51 PM  
Blogger Ragknot said...

I simplified this program, and it speeds it up also.

Sub newseq0()
'10 digit sequences
'Solved
'Var12 = 130760
'Var30 = 194215
'Var90 = 848015
' 2.00000046752393 seconds

Dim a, b, c, d, E, f, g, H, I As Integer
Dim s As String
Dim x As Long
time1 = Now()
For a = 1 To 9
'I know the first variable can't be zero
s = a
For b = 0 To 9
s = Left(s, 1)
If InStr(1, s, b) Then GoTo NXB
s = s & b
For c = 0 To 9
s = Left(s, 2)
If InStr(1, s, c) Then GoTo NXC
s = s & c
For d = 0 To 9
s = Left(s, 3)
If InStr(1, s, d) Then GoTo NXD
s = s & d
For E = 0 To 9
s = Left(s, 4)
If InStr(1, s, E) Then GoTo NXE
s = s & E
For f = 0 To 9
s = Left(s, 5)
If InStr(1, s, f) Then GoTo NXF
s = s & f
For g = 0 To 9
s = Left(s, 6)
If InStr(1, s, g) Then GoTo NXG
s = s & g
For H = 0 To 9
s = Left(s, 7)
If InStr(1, s, H) Then GoTo NXH
s = s & H
For I = 0 To 9
s = Left(s, 8)
If InStr(1, s, I) Then GoTo nxi
s = s & I
For j = 0 To 9
s = Left(s, 9)
If InStr(1, s, j) Then GoTo nxj
s = s & j
x = x + 1
'this tests for solution
Solved = bafflingnumbers(a, b, c, d, E, f, g, H, I, j)
If Solved Then
seconds = (Now() - time1) * 24 * 60 * 60
Debug.Print seconds; "seconds"
GoTo ENND
End If
nxj: Next j
nxi: Next I
NXH: Next H
NXG: Next g
NXF: Next f
NXE: Next E
NXD: Next d
NXC: Next c
NXB: Next b
NXA: Next a
ENND:
End Sub


Function bafflingnumbers(T, W, E, L, V, H, I, R, Y, N) As Boolean
Var12 = Val(T & W & E & L & V & E)
Var30 = Val(T & H & I & R & T & Y)
Var90 = Val(N & I & N & E & T & Y)
If Var12 * 5 + Var30 = Var90 Then
Debug.Print "Solved"
bafflingnumbers = True
Debug.Print "Var12="; Var12
Debug.Print "Var30="; Var30
Debug.Print "Var90="; Var90
End If
End Function

January 7, 2010 10:25 PM  

Post a Comment

Links to this post:

Create a Link

<< Home