Published
Edited
May 23, 2019
Importers
9 stars
Insert cell
Insert cell
digits = function* digits() {
let q = 1n, r = 0n, t = 1n, k = 1n, n = 3n, l = 3n;
while (true) {
if (q * 4n + r - t < n * t) {
yield Number(n);
const nr = (r - n * t) * 10n;
n = (q * 3n + r) * 10n / t - n * 10n;
q *= 10n; r = nr;
} else {
const nr = (q * 2n + r) * l;
const nn = (q * k * 7n + 2n + r * l) / (t * l);
q *= k; t *= l;
l += 2n; k += 1n;
n = nn; r = nr;
}
}
}
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more