Not too too long - after I realized that is was possible to simplify it as such, Tungsten A helped me with the actual condensation.
(Also, since all periodic functions are analytical, they are all presumably inversable with the langrange inversion theorem. Which is cool.)