Okay, this is my version:

R = 1 + i/12

P = ((1-R)RnC0) / (1-Rn)


Where P is the monthly payment, i is the annual interest rate, C0 is the starting capital, n is the number of months after which there is no remaining capital.

This is for compounding monthly. If you want a different compound rate, you can change it around pretty easily.