All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 7+8=12 ?? (Posted on 2016-11-30)
Although the alphametic SEVEN+EIGHT=TWELVE conveys a false message, it has several (how many?) valid solutions.

Find the one with the largest W.

Comments: ( Back to comment list | You must be logged in to post comments.)
 computer solution (spoiler) | Comment 1 of 3
`SEVEN EIGHT TWELVE36465 69781 10624638487 89561 12804858287 80641 13892863732 39841 10357369298 90431 15972985254 50671 135925`

The largest W in the 6 solutions is 5, in

69298+90431=159729

DefDbl A-Z
Dim crlf\$, used(9)

Form1.Visible = True

Text1.Text = ""
crlf = Chr\$(13) + Chr\$(10)

For s = 1 To 9
If used(s) = 0 Then
used(s) = 1
For e = 1 To 9
If used(e) = 0 Then
used(e) = 1
For t = 1 To 9
If used(t) = 0 Then
used(t) = 1
For v = 0 To 9
If used(v) = 0 Then
used(v) = 1
For n = 0 To 9
If used(n) = 0 Then
used(n) = 1
seven = 10000 * s + 1010 * e + 100 * v + n
For i = 0 To 9
If used(i) = 0 Then
used(i) = 1
For w = 0 To 9
If used(w) = 0 Then
used(w) = 1
For l = 0 To 9
If used(l) = 0 Then
used(l) = 1
twelve = 100000 * t + 10000 * w + 1001 * e + 100 * l + 10 * v
For g = 0 To 9
If used(g) = 0 Then
used(g) = 1
For h = 0 To 9
DoEvents
If used(h) = 0 Then
used(h) = 1
eight = 10000 * e + 1000 * i + 100 * g + 10 * h + t
If seven + eight = twelve Then
Text1.Text = Text1.Text & seven & Str(eight) & Str(twelve) & crlf
End If
used(h) = 0
End If
Next
used(g) = 0
End If
Next
used(l) = 0
End If
Next
used(w) = 0
End If
Next
used(i) = 0
End If
Next
used(n) = 0
End If
Next
used(v) = 0
End If
Next
used(t) = 0
End If
Next
used(e) = 0
End If
Next
used(s) = 0
End If
Next

Text1.Text = Text1.Text & crlf & " done"

End Sub

 Posted by Charlie on 2016-11-30 10:29:30

 Search: Search body:
Forums (2)