Five weeks later, the United States election is still going. The big day is next Monday (Tuesday in Australia), when the members of the electoral college meet in their respective states to cast their votes for president and vice-president.

Various attempts are being made to have them do otherwise, but in reality there is no doubt that a majority will choose Donald Trump and Mike Pence (which, in turn, undermines the supposed rationale for the electoral college, but that’s another story).

Yesterday was the deadline, known as the “safe harbour”, for states to certify their results, so we now know not just the makeup of the electoral college (that was clear a month ago) but the totals of votes that elected it. They’re well worth a closer look.

(Unlike pretty much every other democracy, there is no central authority that compiles these totals; the Federal Electoral Commission will eventually produce a tally, but that can take months. I’m using David Leip’s compilationDavid Wasserman has a similar set, with a few minor discrepancies.)

As you’ve no doubt heard, the popular vote overall wasn’t even close. Hillary Clinton won by just on 2.86 million votes, with 51.1% of the two-party total.* In absolute numbers, her more than 65.8 million is by far the most votes ever gained by a losing candidate, and just short (contrary to what the BBC tells us) of Barack Obama’s 2012 total of 65.9 million.

It’s not quite the highest-ever losing percentage, but you have to go back a long way: Samuel Tilden lost the presidency in 1876 (by one vote in the electoral college) despite winning 51.5% of the vote.

Nor is that the only trip to the 19th century to search for precedents. Mitt Romney had 48.0% of the vote in 2012, so the 0.9% swing to the Republicans is the smallest movement either way since 1888. Far from being a revolutionary, “change” election, this year was most striking for its absence of swing.

So how did Trump win? The same way anyone wins a majority of seats with a minority of votes: by having his votes concentrated in just the right places.

Looking at the pre-election pendulum, the Republicans needed a uniform swing of 2.7% for victory. Trump got nowhere near that, but he got good swings in key marginal states: 3.1% in Pennsylvania, 3.9% in Wisconsin, 4.9% in Michigan and 5.8% in Ohio.

Only one state swung more than 10%: Utah, where a conservative independent took votes from Trump and produced a 12.2% swing to the Democrats. The largest swing to the Republicans was 9.7% in already-safe North Dakota.

Ten states were decided with margins of less than 2% — far more than is usual (last time there were just four; in 2008 there were five). Trump won six of those close races (Michigan, Pennsylvania, Wisconsin, Florida, Arizona and North Carolina) and Clinton won four (New Hampshire, Minnesota, Nevada and Maine).

But Trump’s close states were much bigger: those six states account for 101 electoral votes, while Clinton’s four yielded only 22 electoral votes.

Fewer than 40,000 votes would have to have shifted to win Clinton the three closest Trump states, and therefore the presidency.

That’s a tiny number out of 130 million. It makes it plausible to argue that almost any particular factor — such as the late announcement by FBI director Jim Comey of a further investigation of Clinton’s emails — could have determined the result.

But if you’re looking for the sort of irregularities you might pick up in a recount, 40,000 is still an awful lot of votes. So it’s not surprising that a recount in Wisconsin made virtually no change to the result — Trump actually netted an extra 131 votes.

In Michigan, the closest state, a partial recount found a number of irregularities, but no trace of the large-scale hacking that would be necessary to make a difference. And even if the Michigan result were overturned, it would still leave Clinton well short in the electoral college.

When it comes to 2020, the Democrats will need to pick up another 38 electoral votes to win back the White House. On a uniform swing, that would take just 0.4% (for Michigan, Pennsylvania and Wisconsin), but there are now so many marginal Republican states that there will be many possible paths to victory.

For all the talk of the importance of the upper Midwest, the next Democrat candidate could write off all the marginal Midwestern states and still win by taking Florida, Arizona and North Carolina — with Georgia and even Texas also on the target list.

* Technical note: all my percentages are reduced to two-party terms, factoring out the votes for minor parties and independents (which, in a non-preferential system, have no impact on the result). That’s normal for Australia, but it’s not how American sources tend to report them.