What is the smallest integer
that has exactly 4 different partitions into 3 parts with the same product?
a. List these partitions.
b. (optional) Find the second smallest number displaying the above feature.
c. Bonus: Why the specification "exactly"?
The following program backs into the solution by finding all the ways of factoring any number, n, into three factors to find one where the totals of the three factors are identical in four cases.
DefDbl A-Z
Dim crlf$, tots(), cts()
Private Sub Form_Load()
Form1.Visible = True
Text1.Text = ""
crlf = Chr$(13) + Chr$(10)
For n = 4 To 2460375
ReDim tots(4000), cts(4000)
cr = Int(n ^ (1 / 3) + 0.5)
For f1 = 1 To cr
DoEvents
n2 = n / f1
If n2 = Int(n2) Then
For f2 = f1 To Int(Sqr(n2) + 0.5)
n3 = n2 / f2
If n3 = Int(n3) Then
f3 = n3
tot = f1 + f2 + f3
found = 0
For i = 1 To 4000
If tots(i) = 0 Then Exit For
If tots(i) = tot Then
found = 1
cts(i) = cts(i) + 1
Exit For
End If
Next i
If found = 0 Then
tots(i) = tot
cts(i) = 1
End If
End If
Next f2
End If
Next f1
For i = 1 To 4000
If cts(i) >= 4 And tots(i) <= 135 Then
Text1.Text = Text1.Text & n & Str(tots(i)) & Str(cts(i)) & crlf
End If
Next
Next n
Text1.Text = Text1.Text & crlf & " done"
End Sub
The results are
how many
prod. sum tri-partitions
32760 130 4
37800 118 4
45360 135 4
50400 133 4
60480 130 4
done
where the factoring was done on numbers up to 135^3. Numbers higher than this would have factors totalling more than 135.
None were found where there were more than four ways of getting a total and a product to agree, having the total = product <= 135.
The partitions of 118 that multiply to 37800 are:
14 50 54
15 40 63
18 30 70
21 25 72
Now, 130 can be partitioned in exactly four ways so that the partitions multiply out to 32760. But it can also be partitioned in exactly four ways to so these partitions multiply out to 60480.
130 for 32760
-------------
9 56 65
10 42 78
14 26 90
15 24 91
130 for 60480
-------------
20 54 56
21 45 64
24 36 70
28 30 72
I don't think the presence of these two sets of partitionings violate the "exactly 4" rule, as each set independently give exactly 4 for the same product.
But in case that would be disqualified we still have:
For 133 producing 50400:
15 48 70
16 42 75
18 35 80
24 25 84
and 135 producing 45360:
12 60 63
14 40 81
15 36 84
21 24 90
The auxilliary program for these (to list the actual partitions) is:
DefDbl A-Z
Dim crlf$
Private Sub Form_Load()
Form1.Visible = True
Text1.Text = ""
crlf = Chr$(13) + Chr$(10)
tot = 135: prod = 45360
Text1.Text = tot & Str(prod) & crlf
For a = 1 To tot / 3
For b = a To (tot - a) / 2
c = tot - a - b
If a * b * c = prod Then Text1.Text = Text1.Text & a & Str(b) & Str(c) & crlf
Next
Next
Text1.Text = Text1.Text & crlf & " done"
End Sub
with variations in the line
tot = 135: prod = 45360
|
Posted by Charlie
on 2016-03-31 10:32:29 |