Function to calculate Bernoulli numbers using the same algorightm Ada Lovelace used 1842 in (what is widely regarded as) the first ever computer program. Derivation of the formula and the Analytical Engine implementation appear in Note G of Lovelace's notes on Italian mathematician Luigi Menabrea's essay published 1842.
First clone this gist and install dependencies
git clone https://gist.github.com/terotil/3f83a473f372d31f55d5 ada-bernoulli
cd ada-bernoulli
npm install
All the Bernoulli numbers are yours to take!
var adaBernoulliNumber = require("../bernoulli");
adaBernoulliNumber(5);
// => 1/42
Run tests
npm test
This is incredible! Great work!