I stumbled over an interesting codeunit in Business Central to help calculate recurrences. Check out the video:

https://youtu.be/SD1GKUK_RTM