Hi ro67, you beat me by 22 minutes since I forgot to keep checking. Took me about 7 minutes from the time I remembered to check it. I just wrote a quick script to multiply all 3 digit numbers composed of 2, 3, 5 and 7 against all 2 digit numbers composed of 2, 3, 5 and 7. Made sure the intermediate values and the final value were all made up of 2, 3, 5 and 7 and printed out anything that matched. Only one possibility came up, so that was the answer.
Maybe I'll finally get my avatar, but I wish I'd checked earlier.
I suppose since the answer is already posted, I might as well include the script for anyone that wants it. ASP (VBScript) code.
Code:
'd contains the allowed digits
dim d(4)
'a1, a2, and a3 are the array indexes for the digits of the top number
'b1 and b2 are the array indexes for the digits of the bottom number
dim a1, a2, a3, b1, b2
'top is the top 3-digit number and bot is the bottom 2-digit number
'prod is their product, and s is just the string form of it
'l1 and l2 are the first and second intermediate values,
'while s1 and s2 are the string forms
dim top, bot, prod, s, l1, l2, s1, s2
t(1) = 2
t(2) = 3
t(3) = 5
t(4) = 7
'Loop through all the possible digits for each of the 5 digit
'positions in the two numbers to multiply.
for a1 = 1 to 4
for a2 = 1 to 4
for a3 = 1 to 4
for b1 = 1 to 4
for b2 = 1 to 4
top = 100 * d(a1) + 10 * d(a2) + d(a3)
bot = 10 * d(b1) + d(b2)
prod = top * bot
s = cstr(prod)
'First check the product to see if it has any of the 6 digits we
'don't want.
if instr(s, "0") = 0 and instr(s, "1") = 0 and instr(s, "4") = 0 and _
instr(s, "6") = 0 and instr(s, "8") = 0 and instr(s, "9") = 0 then
l1 = top * d(b2)
l2 = top * d(b1)
s1 = cstr(l1)
s2 = cstr(l2)
'Now check the intermediate values
if instr(s1, "0") = 0 and instr(s1, "1") = 0 and instr(s1, "4") = 0 and _
instr(s1, "6") = 0 and instr(s1, "8") = 0 and instr(s1, "9") = 0 then
if instr(s2, "0") = 0 and instr(s2, "1") = 0 and instr(s2, "4") = 0 and _
instr(s2, "6") = 0 and instr(s2, "8") = 0 and instr(s2, "9") = 0 then
'Print the values when we find a good one.
Response.Write top & ", " & bot & ", " & l1 & ", " & l2 & ", " & prod & "<br>"
end if
end if
end if
next
next
next
next
next