Sub ИФН2()
Const n = 20, e = 0.0000000000001, x = 1.5
Dim i As Integer, xN As Double, xN1 As Double, t As Double, dy((n + 1) * (n + 2) / 2 - 1) As Double, P As Double, c As Double, z As Double, k As Integer, j As Integer, P1 As Double
xN = Cells(n + 1, 1)
xN1 = Cells(n, 1)
c = 1
z = 1
t = (x - xN) / (xN - xN1)
dy(0) = Cells(1, 2)
P = dy(i)
For i = 1 To n
k = i * (i + 1) / 2
dy(k) = Cells(n - i + 1, 2)
For j = 1 To i
dy(k + j) = -((dy(k + j - 1) - dy(k + j - i - 1)))
Next j
c = c * (t + (i - 1))
z = z * i
P1 = c / z * dy(k + i)
If Abs(P1) < e Then Exit For
P = P + P1
Next i
Debug.Print P, i - 1, Abs(P1)
End Sub