Recursionhard
0:00.0

Euler's pentagonal number theorem relates the partition function p(n)p(n) (number of ways to partition nn) via the recurrence: p(n)=k0(1)k+1p(nk(3k1)2)p(n) = \sum_{k \neq 0} (-1)^{k+1} p\left(n - \frac{k(3k-1)}{2}\right) Given that p(0)=1,p(1)=1,p(2)=2,p(3)=3,p(4)=5p(0) = 1, p(1) = 1, p(2) = 2, p(3) = 3, p(4) = 5, compute p(5)p(5) using the first few terms of this recurrence.