Published
Edited
Feb 18, 2019
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
R1 = {
const a = 1.0 / phi1;
let p = 0.5; // arbitrary root
do {
p = (p + a) % 1;
yield [p]; // presented as an array, so it can be generalized (see below)
} while (true);
}
Insert cell
Insert cell
phi2 =
Math.pow(1 / 2 + Math.sqrt(69) / 18, 1 / 3) +
Math.pow(1 / 2 - Math.sqrt(69) / 18, 1 / 3)
Insert cell
Insert cell
Insert cell
Insert cell
phi(3)
Insert cell
R(3)
Insert cell
Insert cell
R(39)
Insert cell
function phi(d) {
return solve(x => pow(x, d + 1) - x - 1, 0, 1);
}
Insert cell
function* R(d) {
const f = phi(d),
a = [];
let p = [];
for (let l = 1.0, i = 0; i < d; i++) {
a.push((l = l / f));
p.push(0.5);
}
do {
yield (p = p.map((d, i) => (p[i] + a[i]) % 1));
} while (true);
}
Insert cell
Insert cell
Insert cell
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