Hi guys I want to calculate the number of integer partitions. So that I use this code
Function p(m As Integer, n As Integer) If m = 1 Or n = 1 Then p(m, n) = 1 Else If n > m Then p(m, n) = p(m, m) Else If m = n Then p(m, n) = p(m, m - 1) + 1 Else p(m, n) = p(m, n - 1) + p(m - n, n) End If End If End If End Function Sub Integer_partitions() Debug.Print p(5, 5) End Sub
But I get the error as " Run time error 28 Out of stuck space".
What's wrong with my code?
Regards,
Alex