A. I don’t know of an algorithm, but Chabad.org has a date converter tool to figure these type of things out. I’m not sure how they do it. Back in our yeshiva days we had a classmate who had a brilliant mind especially for certain areas of study and he’d be able to calculate this kind of thing off the top of his head.