Let
N denote an integer number such that:
I. N is a 3-digit number abc.
ii. a,b,c are distinct non-zero decimal digits.
iii. The product a*b*c divides N.
List all possible values for (a,b,c) complying with the above conditions.
For n = 100 To 999
s$ = LTrim(Str(n))
prod = 1: good = 1
For i = 1 To Len(s$)
prod = prod * Val(Mid(s$, i, 1))
If InStr(s$, Mid(s$, i, 1)) <> i Or prod = 0 Then
good = 0
Exit For
End If
Next
If good Then
ct = ct + 1
If n Mod prod = 0 Then
Text1.Text = Text1.Text & n & Str(prod) & crlf
goodct = goodct + 1
End If
End If
Next
N product of digits
128 16
132 6
135 15
175 35
216 12
312 6
315 15
384 96
432 24
612 12
624 48
672 84
735 105
816 48
|
Posted by Charlie
on 2015-01-14 22:24:18 |