In 1843, Ada Lovelace became the first person to publish what we would now call a computer program, a set of instructions to calculate Bernoulli’s Numbers, written for Charles Babbage’s unbuilt Analytical Engine. Lovelace had translated a paper about the Analytical Engine written in French by Italian mathematician Luigi Menabrea, and had at Babbage’s suggestion added her own notes explaining the potential of the Analytical Engine in depth.
The interactive notebook begins with the Gauss Schoolboy Problem:
As a young schoolboy, [German mathematician Carl Friedrich Gauss] was tasked with adding the first 100 integers, i.e. what is 1 + 2 + 3 + 4 + … + 98 + 99 + 100? (The answer is 5,050.) Gauss reportedly produced the correct answer within seconds. How did he do this?
The workbook demonstrates how to calculate these numbers, and thus then how to calculate Bernoulli Numbers, “a sequence of rational numbers with deep connections to number theory.” From the workbook:
Back in the 1600s, people spent their lives making tables of sums of powers of integers. But Jakob Bernoulli pointed out that all such sums can be expressed as polynomials, with the coefficients being related to what are now called Bernoulli numbers. And in 1713, Bernoulli was proud to say that he had computed the first 10 Bernoulli numbers ‘in a quarter of an hour’—reproducing years of other people’s work.
Ada Lovelace was calculating these numbers by hand!
You can also scans of Lovelace’s letter to Babbage discussing the Bernoulli numbers at the end of the workbook.