Pentagonal recurrence

P(n) = sum_{k≥1} (-1)^(k-1) [P(n - g_k) + P(n - g_{-k})] where g_k = k(3k-1)/2 pentagonal numbers.

Advertisement

Complexity

Fast: O(N^(1.5)) for all P(n), n ≤ N. Slower DP O(N²).

Advertisement

Restricted partitions

Distinct parts. Parts from given set. Each has closed-form generating function.

Ramanujan's congruences

P(5n+4) ≡ 0 mod 5. P(7n+5) ≡ 0 mod 7. P(11n+6) ≡ 0 mod 11. Beautiful patterns.