There probably is an easy formula. Sadly, SS and Medicare is a useful political football. It's a disgusting and evil way that politicians use the elderly in America.
Some of these 'fixes' are already in, including paying more in and raising retirement age.
Social Security Disability is a criminal scam. The intended recipients take a back seat to the criminals. Huge amounts of money paid out to scammers. Yes, take a hatchet to it, and prosecute the abusers inside and out.
I don't see the same issues with Medicare unless combined with the Disability scams. Get rid of the Disability scams and their health payments go away too.