Express 1/2 as the sum of Square Egyptian Numbers with distinct denominators under 36
2.
I.e. reciprocals of perfect squares.
1/2 = 1/4 + 1/9 + 1/16 + 1/25 + 1/49 + 1/144 + 1/225 + 1/400 + 1/784 + 1/1225
The denominators are the squares of:
2 3 4 5 7 12 15 20 28 35
as found by the below VB program and verified by using exact rational fractions in UBASIC.
The program produces a total that prints out as exactly .5 but did not register as equal to .5 within the program, due to rounding, and thus necessitated the difference to be below the small threshhold of absolute value difference shown in the program, rather than testing if = 0.5.
The first portion of the program determined how far back from 1/36^2 would be necessary and found that the first term must be 1/2^2, otherwise the total would be impossible. It was only after this was run that the rest of the program was added, to find the actual result.
DefDbl A-Z
Dim crlf$, h(36), tot
Private Sub Form_Load()
Form1.Visible = True
Text1.Text = ""
crlf = Chr$(13) + Chr$(10)
For rt = 36 To 1 Step -1
ptot = tot
tot = tot + 1 / (rt * rt)
If tot >= 0.5 Then Text1.Text = Text1.Text & rt & Str(tot) & Str(ptot) & crlf & crlf: Exit For
Next
h(1) = 4: tot = 1 / 4
addOn 2
Text1.Text = Text1.Text & crlf & " done"
End Sub
Sub addOn(wh)
DoEvents
st = Int(Sqr(h(wh - 1)) + 0.5) + 1
For i = st To 36
h(wh) = i * i
savetot = tot
tot = tot + 1 / (i * i)
If Abs(tot - 0.5) < 0.000000000001 Then
Text1.Text = Text1.Text & tot & crlf & " "
For j = 1 To wh
Text1.Text = Text1.Text & " + 1/" & h(j)
Next
Text1.Text = Text1.Text & crlf
For j = 1 To wh
Text1.Text = Text1.Text & Str(Sqr(h(j)))
Next
Text1.Text = Text1.Text & crlf
End If
If i < 36 And tot < 0.5001 Then
addOn wh + 1
End If
tot = savetot
Next
End Sub
2 .617538519845469 .367538519845469
0.5
+ 1/4 + 1/9 + 1/16 + 1/25 + 1/49 + 1/144 + 1/225 + 1/400 + 1/784 + 1/1225
2 3 4 5 7 12 15 20 28 35
|
Posted by Charlie
on 2017-06-28 13:59:04 |