Ada Lovelace’s ‘Notes’ contained the first published computer program. More of a trace than an actual listing, it used an iterative algorithm to calculate Bernoulli numbers.

Here is the recreated algorithm in Julia. Ada’s original didn’t describe conditions for the repetition of operations 13 to 23, and it wasn’t clear how the array of result variables would actually be populated on the Analytical Engine. However, everything else is pretty much how her program was originally described (apart from fixing Ada’s bug in operations 4 and 24).

The results, converting to current notation (Ada’s program calculates *B*_{2n}), are:

*B _{2}* = 1/6

*B*= -1/30

_{4}*B*= 1/42

_{6}*B*= -1/30

_{8}*B*= 5/66

_{10}*B*= -691/2730

_{12}*B*= 7/6

_{14}*B*= -3617/510

_{16}*B*= 43867/798

_{18}*B*= -174611/330

_{20}