Gracie Mansion, the official residence of New York’s mayors since 1942, hosted billionaire Michael Bloomberg for three terms.

The first of these terms began after Bloomberg, then the Republican candidate for mayor, spent an incredible $74 million to get himself elected in 2001. He spent, in effect, $99 for every vote he received.

Four years later, Bloomberg — who made his fortune selling high-tech information systems to Wall Street — had to spend even more to get himself re-elected. His 2005 campaign bill came to $85 million, about $112 per vote.

In 2009, he had the toughest sledding yet. Bloomberg first had to maneuver his way around term limits, then convince a distinctly unenthusiastic electorate to give him a majority. Against a lackluster Democratic Party candidate, Bloomberg won that majority — but just barely, with 51 percent of the vote.

That majority cost Bloomberg $102 million, or $174 a vote.

Now Bloomberg has announced he’s running for president as a Democrat, arguing he has the best chance of unseating President Trump, whom he describes as an “existential threat.” Could he replicate his lavish New York City campaign spending at the national level? Could he possibly afford to shell $174 a vote nationwide — or even just $99 a vote?

Let’s do the math. Donald Trump won the White House with just under 63 million votes. We can safely assume that Bloomberg would need at least that 63 million. At $100 a vote, a victory in November 2020 would run Bloomberg $6.3 billion.

Bloomberg is currently sitting on a personal fortune worth $52 billion. He could easily afford to invest $6.3 billion in a presidential campaign — or even less on a primary.

Indeed, $6.3 billion might even rate as a fairly sensible business investment. Several of the other presidential candidates are calling for various forms of wealth taxes. If the most rigorous of these were enacted, Bloomberg’s grand fortune would shrink substantially — by more than $3 billion next year, according to one estimate.

In other words, by undercutting wealth tax advocates, Bloomberg would save over $6 billion in taxes in just two years — enough to cover the cost of a $6.3 billion presidential campaign, give or take a couple hundred million.

Bloomberg, remember, wouldn’t have to win the White House to stop a wealth tax. He would just need to run a campaign that successfully paints such a tax as a clear and present danger to prosperity, a claim he has already started making.

Bloomberg wouldn’t even need to spend $6.3 billion to get that deed done. Earlier this year, one of Bloomberg’s top advisers opined that $500 million could take his candidate through the first few months of the primary season.

How would that $500 million compare to the campaign war chests of the two primary candidacies Bloomberg fears most? Bernie Sanders raised $25.3 million in 2019’s third quarter for his campaign, Elizabeth Warren $24.6 million. Both candidates are collecting donations — from small donors — at a $100 million annual pace.

Bloomberg could spend 10 times that amount on a presidential campaign and still, given his normal annual income, end the year worth several billion more than when the year started.

Most Americans don’t yet believe that billionaires shouldn’t exist. But most Americans do believe that America’s super rich shouldn’t be able to buy elections or horribly distort their outcomes.

But unfortunately, they can — or at least, you can be sure they’ll try.