Skip to content

Instantly share code, notes, and snippets.

@FreddieRidell
Last active January 21, 2020 13:48
Show Gist options
  • Select an option

  • Save FreddieRidell/ffcfe5a59e1387ff8fd38dfd877f98f9 to your computer and use it in GitHub Desktop.

Select an option

Save FreddieRidell/ffcfe5a59e1387ff8fd38dfd877f98f9 to your computer and use it in GitHub Desktop.
const R = require("ramda");
let stamps = [];
let i = 0;
while (++i) {
stamps = R.pipe(
R.append(i),
R.groupBy(x => Math.floor(3 * Math.log(i - x + 1, 2))),
R.values,
R.map(R.head),
R.sortBy(R.identity)
)(stamps);
console.log(stamps.join("\t"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment