Let (a, b, c) denote a triplet of distinct integers in an ascending order.
If
a2+ b2=c2+1 or if
a2+ b2=c2- 1 we will call such a triplet an
ARAT (since it represents an almost-right-angle triangle) .
(4,8,9) is such a triplet.
How many ARATs are there, provided c<1,000,000?
The revised version shows 311,395 triplets with c less than 100,000. The first 100 (in order of increasing a+b) are shown:
4 7 8
4 8 9 *
8 9 12
7 11 13
6 17 18
6 18 19 *
11 13 17
10 15 18
9 19 21
14 17 22
13 19 23
17 21 27
8 31 32
16 23 28
8 32 33 *
11 29 31
15 26 30
14 31 34
20 25 32
19 27 33
18 30 35 *
17 34 38
23 29 37
22 31 38
13 41 43
16 41 44
10 49 50
26 33 42
10 50 51 *
25 35 43
19 43 47
23 41 47
31 34 46
29 37 47
28 39 48
22 46 51 *
15 55 57
34 38 51 *
32 41 52
21 53 57
25 49 55
31 43 53
24 55 60
35 45 57
34 47 58
12 71 72
12 72 73 *
20 65 68
23 64 68
31 56 64
38 49 62
17 71 73
37 51 63
26 65 70
41 53 67
40 55 68
29 67 73
33 64 72
49 50 70
22 79 82
25 76 80
44 57 72
43 59 73
28 76 81 *
41 64 76
51 55 75
19 89 91
31 77 83
47 61 77
46 63 78
39 71 81
14 97 98
14 98 99 *
44 68 81 *
34 79 86
43 71 83
50 65 82
27 89 93
49 67 83
41 79 89
53 69 87
52 71 88
36 89 96
56 73 92
21 109 111
39 91 99
55 75 93
29 103 107
32 100 105 *
47 86 98
35 99 105
59 77 97
26 111 114
58 79 98
69 71 99
65 76 100
41 101 109
16 127 128
49 94 106
62 81 102
Asterisk indicates a^2 + b^2 < c^2 (by 1 of course).
Intermediate totals are shown for increments of 5000 total a+b:
8013 5000 17795 10000 28249 15000 39092 20000 50297 25000 61813 30000 73381 35000 85245 40000 97192 45000 109350 50000 121647 55000 134021 60000 146514 65000 159070 70000 171773 75000 184488 80000 197281 85000 210189 90000 223189 95000 236269 100000 249196 105000 261363 110000 272695 115000 283099 120000 292442 125000 300337 130000 306683 135000 311022 140000
311395 done
DefDbl A-Z
Dim crlf$
Private Sub Form_Load()
Form1.Visible = True
Text1.Text = ""
crlf = Chr$(13) + Chr$(10)
For tot = 3 To 141422
For a = 1 To tot / 2
DoEvents
b = tot - a
If b > a Then
a2 = a * a: b2 = b * b
c2 = a2 + b2
sr = Int(Sqr(c2) + 0.5)
If Abs(sr * sr - c2) = 1 And sr < 100000 And sr > b Then
ct = ct + 1
If ct < 101 Then
Text1.Text = Text1.Text & a & Str(b) & Str(sr) & " "
If (sr * sr - c2) > 0 Then
Text1.Text = Text1.Text & "*" & crlf
Else
Text1.Text = Text1.Text & crlf
End If
End If
End If
End If
Next
If tot Mod 5000 = 0 Then Text1.Text = Text1.Text & Str(ct) & Str(tot) & " "
Next
Text1.Text = Text1.Text & crlf & crlf & ct & " done"
End Sub
|
Posted by Charlie
on 2016-09-07 12:57:02 |