Find the smallest positive integer multiple of 84 whose base ten representation uses only the two digits 6 and 7.
DefDbl A-Z
Dim crlf$
Private Sub Form_Load()
ChDir "C:\Program Files (x86)\DevStudio\VB\projects\flooble"
Text1.Text = ""
crlf$ = Chr(13) + Chr(10)
Form1.Visible = True
DoEvents
m = 84
For i = 2 To 10000000
m = m + 84
ms$ = LTrim$(Str$(m))
good = 1
For j = 1 To Len(ms$)
If InStr("67", Mid(ms$, j, 1)) = 0 Then good = 0
Next
If good Then
Text1.Text = Text1.Text & i & Str(m) & crlf
DoEvents
End If
Next
Text1.Text = Text1.Text & crlf & "done"
End Sub
finds
mult. product
914 76776
9139 767676
91389 7676676
793664 66667776
913889 76766676
925914 77776776
7936639 666677676
7948414 667666776
8068664 677767776
9138889 767666676
9246164 776677776
9259139 777767676
There seems to be a pattern in 9138...89 as the multiplier for 84 producing 76766...676, plus other patterns possibly forming.
The lowest, as answer to the puzzle, is 914 * 84 = 76776.
|
Posted by Charlie
on 2014-08-02 14:26:11 |