Published
Edited
Nov 2, 2021
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
digitFactorsTree = (num, base) => {
const digits = decomposeNumberToArray(num, base);
const sums = digits
.map((v, i, a) => composeArrayToNumber(a.slice(a.length - (i + 1)), base))
.reverse();
return buildTree(
digits.map((v, i, a) => [
sums[i],
v * Math.pow(base, a.length - (i + 1)),
Math.pow(base, a.length - (i + 1)),
v
]),
0,
generatorFactory()
);
}
Insert cell
Insert cell
Insert cell
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import {verticalStack,horizontalStack} from "@rsamec/stacks"
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