Is there a reverse formula out there to the Shockingly Simple Math formula?

If we want to retire in X years I would like it to solve for the amount we’d need to save monthly so we know how much more money we would need to make.

For example, we want our portfolio to provide $45k a year ($45k x 25 = $1.125m). Using the same 5% how do we calculate we’d need To contribute X in order to retire in 10 years, or maybe we’d want to retire in 7 years, how much harder would we have to work?

Thanks!