Find the smallest pythagorean triple a<b<c where c/a is within 0.005 of 1.54 and then do the same for c/b.
Quantity b is the length of the longer leg of the right triangle with c as the hypotenuse. The ratio of c to b can never exceed sqrt(2), so the second part is impossible.
For part one, the answer is (133, 156, 205), the first such on the following table showing all cases where c is under 30,000 and GCD(a,b,c)=1.
a b c c/a off target
133 156 205 1.54135338345865 0.00135
540 629 829 1.53518518518519 0.00481
1564 1827 2405 1.53772378516624 0.00228
1764 2077 2725 1.54478458049887 0.00478
1971 2300 3029 1.53678335870117 0.00322
3120 3649 4801 1.53878205128205 0.00122
3400 3999 5249 1.54382352941176 0.00382
4551 5320 7001 1.53834322127005 0.00166
5031 5920 7769 1.54422580003975 0.00423
5208 6095 8017 1.53936251920123 0.00064
5568 6545 8593 1.54328304597701 0.00328
5969 6960 9169 1.53610319986597 0.00390
7400 8631 11369 1.53635135135135 0.00365
7828 9165 12053 1.53972917731221 0.00027
8195 9588 12613 1.53910921293472 0.00089
8268 9715 12757 1.5429366231253 0.00294
8835 10388 13637 1.54352009054895 0.00352
10065 11752 15473 1.53730750124193 0.00269
10472 12225 16097 1.53714667685256 0.00285
10980 12859 16909 1.53998178506375 0.00002
11500 13509 17741 1.54269565217391 0.00270
12127 14136 18625 1.53582914158489 0.00417
12903 15104 19865 1.53956444237774 0.00044
13703 16104 21145 1.54309275341166 0.00309
14664 17177 22585 1.5401663938898 0.00017
15225 17792 23417 1.53806239737274 0.00194
15264 17927 23545 1.54251834381551 0.00252
16985 19992 26233 1.54448042390344 0.00448
17556 20467 26965 1.53594212804739 0.00406
18212 21285 28013 1.53816165165825 0.00184
18675 21868 28757 1.53986613119143 0.00013
18880 22119 29081 1.54030720338983 0.00031
The output of the following was massaged for the above to line up the columns.
DefDbl A-Z
Dim crlf$
Private Sub Form_Load()
Form1.Visible = True
Text1.Text = ""
crlf = Chr$(13) + Chr$(10)
For c = 1 To 30000
val0 = c / 1.54
For a = Int(val0) To 1 Step -1
DoEvents
If c / a > 1.545 Then Exit For
b2 = c * c - a * a
b = Int(Sqr(b2) + 0.5)
If b * b = b2 And gcd(gcd(a, b), c) = 1 Then
Text1.Text = Text1.Text & a & Str(b) & Str(c) & " " & c / a & " " & Format$(Abs(c / a - 1.54), "0.00000") & crlf
End If
Next a
For a = Int(val0) + 1 To c - 1
DoEvents
If c / a < 1.535 Then Exit For
b2 = c * c - a * a
b = Int(Sqr(b2) + 0.5)
If b * b = b2 And gcd(gcd(a, b), c) = 1 Then
Text1.Text = Text1.Text & a & Str(b) & Str(c) & " " & c / a & " " & Format$(Abs(c / a - 1.54), "0.00000") & crlf
End If
Next a
Next c
Text1.Text = Text1.Text & crlf & " done"
End Sub
Function gcd(a, b)
x = a: y = b
Do
q = Int(x / y)
z = x - q * y
x = y: y = z
Loop Until z = 0
gcd = x
End Function
|
Posted by Charlie
on 2017-07-08 11:49:48 |