Twice in American history, we have had three Presidents in the same calendar year, due to the inauguration of a new President, and the death of that new President the same year.
The years involved are 1841 and 1881.
In 1841, losing President Martin Van Buren left office on March 4, was succeeded by his winning opponent William Henry Harrison, who died a month later precisely (April 4) of pneumonia, and was succeeded by Vice President John Tyler, the first unelected President.
in 1881, retiring President Rutherford B. Hayes was succeeded on March 4 by incoming President James A. Garfield, who was shot four months later, and after two and a half months of suffering, died on September 19, and was succeeded by Vice President Chester Alan Arthur, the fourth of five Presidents never elected to the Presidency.
The odds of such an event happening another time seems highly unlikely, but it managed to happen twice in forty years!