Last active
December 17, 2023 02:32
-
-
Save siberex/cc4b805cdd6f64d43532ac8f88cb190f to your computer and use it in GitHub Desktop.
Single-digit multiplication is just a mapping of a set of 55 (distinct) values to a set of 37 (distinct) values
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const multipliers = new Map(); | |
const multiplications = new Set(); | |
for (let i = 0; i < 10; i++) { | |
for (let j = i; j < 10; j++) { | |
const res = i * j; | |
multiplications.add(res); | |
multipliers.set( | |
i.toString() + j.toString(), | |
res, | |
); | |
const logRes = Math.round( | |
Math.pow(10, Math.log10(i) + Math.log10(j)) | |
); | |
console.assert(res === logRes); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See also:
Irish logarithm
Percy Ludgate’s Logarithmic Indexes