a b n
48 17 2
84 71 2
204 199 2
1008 1007 2
14 9 3
from
DefDbl A-Z
Dim crlf$
Private Sub Form_Load()
Form1.Visible = True
Text1.Text = ""
crlf = Chr$(13) + Chr$(10)
For n = 2 To 11
tot = 3
Do
'Text1.Text = Text1.Text & tot & crlf
DoEvents
noSoln = 0
soln = 0
For b = Int(tot / 2) To 1 Step -1
a = tot - b
aton = Int(a ^ n + 0.5)
bton = Int(b ^ n + 0.5)
If aton > maxnum Then maxnum = aton
If bton > maxnum Then maxnum = bton
diff = aton - bton
If diff > 2015 And a - b = 1 Then noSoln = 1: Exit For
If diff > 2015 Then Exit For
If diff = 2015 Then
Text1.Text = Text1.Text & a & Str(b) & Str(n) & crlf
Exit For
End If
Next
tot = tot + 1
Loop Until noSoln
Next
Text1.Text = Text1.Text & crlf & maxnum & " done"
End Sub
|
Posted by Charlie
on 2015-06-30 16:19:44 |