F(n) denotes the largest prime divisor of a
positive integer n.
Determine all possible triplets (A,B,C) of
strictly increasing positive integers such that:
- A, B and C are in arithmetic sequence, and:
- F(A*B*C) ≤ 3
These three sets form the basis of an infinite number of sets:
(1, 2, 3)
(2, 3, 4)
(2, 9, 16)
multiply any one of these three sets by any number that's a product of powers of 2 and 3, and you get another set.
Before the GCD test in the below program was added, many more were found. The GCD test showed all are based on the above three, having tested all cases where a+c <= 30,000.
DefDbl A-Z
Dim crlf$
Private Sub Form_Load()
Form1.Visible = True
Text1.Text = ""
crlf = Chr$(13) + Chr$(10)
For tot = 4 To 30000
For a = 1 To (tot - 1) / 2
DoEvents
If test(a) Then
c = tot - a
b = (a + c) / 2
If b = Int(b) Then
If gcd(a, b) = 1 Then
If test(b) Then
If test(c) Then
Text1.Text = Text1.Text & a & Str(b) & Str(c) & crlf
End If
End If
End If
End If
End If
Next
Next
Text1.Text = Text1.Text & crlf & " done"
End Sub
Function test(x)
t = x
While t Mod 2 = 0
t = t / 2
Wend
While t Mod 3 = 0
t = t / 3
Wend
If t = 1 Then test = 1 Else test = 0
End Function
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 2016-01-03 10:57:44 |