Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I'll have to think about that a little more, but I think you can. You will have to come up with a more general formula than the one I gave above. In particular, you need to replace the infinite sum a(i)q^i with an integral.