The values through S(14) show the numbers cycle with a period of 10, so all the S values whose subscripts end with the same digit have the same value. However, I had written the program before finding this out:
subscript value
5 267
6 -211
7 -375
8 -420
9 -523
10 -267
11 211
12 375
13 420
14 523
15 267
16 -211
17 -375
18 -420
19 -523
531 211
753 420
975 267
----
total of 3 898
so the answer is 898.
Text1.Text = ""
crlf = Chr$(13) + Chr$(10)
a = 211: b = 375: c = 420: d = 523
For j = 5 To 975
DoEvents
e = d - c + b - a
a = b: b = c: c = d: d = e
If e > 10000000 Then
x = x
End If
If j < 20 Or j = 531 Or j = 753 Or j = 975 Then
Text1.Text = Text1.Text & j & " " & e & crlf
If j > 20 Then tot = tot + e
End If
If j = 30 Then Text1.Text = Text1.Text & crlf
Next
Text1.Text = Text1.Text & tot & crlf & " done"
End Sub
|
Posted by Charlie
on 2015-10-29 14:31:45 |