views:

165

answers:

2

There is a recurrence equation on page 1789 of this paper and I need some help making a python program to calculate pi_i. I have no idea what is going on here.

Other references:original paper, pages (according to adobe, not the physical pages) 43 and 86

edit and i had already deleted what i wrote because all the answers i got were 0, even though all the values were floats. i believe what i had looked somewhat like the code posted below

A: 

you will need to calculate the intermediate values as described in the paper, then loop on them to add them where you see the big summation signs...

Randy
thanks. but im getting nowhere with what i have tried so far
calccrypto
+1  A: 

Here's a pseudocode/VBAish answer:

Function T(i as Integer, n as Integer, m as Integer) As Double

Dim j As Integer, temp As Double

Select Case i
    Case 0
        If n < 1 Then
            n = 1
        Else
            If n < m Then
                T = 2 * T(0,n-1)
            Else
                T = 2 * T(0,n-1) - T(0,n-m-1)
            End If
        End If
    Case 1
        If n < m Then
            T = 0
        Else
            If n = m Then
                T = 1
            Else
                If n = m + 1 Then
                    T = 2
                Else
                    temp = 0
                    For j = -1 to n-m-1
                        temp = temp + T(0,j) * T(0,n-m-2-j)
                    Next j
                    T = temp
                End If
            End If
        End If
    Case 2 to 9999999
        temp = 0
        For j = -1 to n-2*m-i
            temp = temp + T(0,j) * T(i-1,n-m-2-j)
        Next j
        T = T(i-1,n-1) + temp
End Case

End Function
Lance Roberts