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
For y = 1 To 10000
For q = 1 To 10000
x = y * q
s = x + y
prod = x * y
If s - q = prod - s Then
Text1.Text = Text1.Text & x & Str(y) & " " & q & Str(s) & Str(prod) & crlf
DoEvents
End If
Next
Next
Text1.Text = Text1.Text & "--------------" & crlf
For y = 1 To 10000
For q = 1 To 10000
x = y * q
s = x + y
diff = x - y
If q * s = diff * diff Then
Text1.Text = Text1.Text & x & Str(y) & " " & q & Str(diff) & Str(s) & crlf
DoEvents
End If
Next
Next
Text1.Text = Text1.Text & crlf & " done"
End Sub
finds for parts A and B, separated by a line of hyphens:
x y series
8 2 4 10 16
---------------
9 3 3 6 12
12 6 2 6 18
|
Posted by Charlie
on 2014-10-10 14:55:13 |