x y z
9 44 1
18 88 2
27 132 3
36 176 4
45 220 5
96 203 5
149 168 5
54 264 6
63 308 7
72 352 8
81 396 9
90 440 10
99 484 11
192 406 10
298 336 10
108 528 12
112 573 13
117 572 13
126 616 14
135 660 15
328 483 13
144 704 16
288 609 15
153 748 17
217 732 17
447 504 15
162 792 18
171 836 19
180 880 20
487 588 17
189 924 21
198 968 22
384 812 20
92 1119 25
207 1012 23
596 672 20
216 1056 24
225 1100 25
224 1146 26
234 1144 26
243 1188 27
252 1232 28
480 1015 25
524 993 25
261 1276 29
745 840 25
270 1320 30
656 966 26
279 1364 31
288 1408 32
297 1452 33
576 1218 30
691 1104 29
306 1496 34
744 1069 29
315 1540 35
213 1648 37
36 1841 41
434 1464 34
894 1008 30
324 1584 36
333 1628 37
342 1672 38
336 1719 39
351 1716 39
672 1421 35
360 1760 40
974 1176 34
369 1804 41
1043 1176 35
378 1848 42
843 1432 37
387 1892 43
396 1936 44
405 1980 45
768 1624 40
184 2238 50
984 1449 39
756 1679 41
414 2024 46
423 2068 47
1192 1344 40
432 2112 48
441 2156 49
450 2200 50
864 1827 45
459 2244 51
448 2292 52
468 2288 52
56 2739 61
477 2332 53
651 2196 51
1341 1512 45
486 2376 54
495 2420 55
504 2464 56
960 2030 50
513 2508 57
1048 1986 50
137 2916 65
As per Steve Herman's comment, each X and Y can be interchanged.
DefDbl A-Z
Dim crlf$
Private Sub Form_Load()
Form1.Visible = True
Text1.Text = ""
crlf = Chr$(13) + Chr$(10)
For tot = 2 To 10000
For x = 1 To tot / 2
y = tot - x
z2 = (x * x + y * y) / 2017
If z2 = Int(z2) Then
z = Int(Sqr(z2) + 0.5)
If z * z = z2 Then
Text1.Text = Text1.Text & mform(x, "####0") & mform(y, "####0") & mform(z, "##0") & crlf
DoEvents
ct = ct + 1
If ct > 99 Then Exit Sub
End If
End If
Next
Next
Text1.Text = Text1.Text & crlf & " done"
End Sub
Function mform$(x, t$)
a$ = Format$(x, t$)
If Len(a$) < Len(t$) Then a$ = Space$(Len(t$) - Len(a$)) & a$
mform$ = a$
End Function
|
Posted by Charlie
on 2015-09-13 14:54:43 |