Private Sub Command1_Click()
Dim n As Long
Dim i As Long
Dim sum As Double
n = Val(Text1.Text)
sum = 1#
For i = 2 To n
'sum = sum + (-1) ^ i * 1 / (2 * (i - 1) + 1)
If 2 * Int(i / 2) = i Then
sum = sum + 1 / (2 * (i - 1) + 1)
Else
sum = sum - 1 / (2 * (i - 1) + 1)
End If
Next i
Label1.Caption = sum
End Sub
s=0
for i=1 to n step 6
s=s+1/i+1/(i+2)-1/(i+4)
next i