This file contains hidden or 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
/** | |
* Generate Recamán sequence up to `maxNum` | |
* https://youtu.be/FGC5TdIiT9U | |
* | |
* @param {Number} maxNum | |
* @returns {Set} | |
*/ | |
function recaman (maxNum) { | |
const result = new Set([0]) | |
let current, hop |
This file contains hidden or 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
/** | |
* Generate fibonacci sequence up to `maxNum` | |
* https://en.wikipedia.org/wiki/Fibonacci_number | |
* | |
* @param {number} maxNum | |
*/ | |
function fibonacci (maxNum) { | |
const result = [0, 1] | |
let newNum, index |
This file contains hidden or 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
/** | |
* Generate Set of prime numbers up to `maxPrime` | |
* https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes | |
* | |
* @param {Number} maxPrime | |
* @returns {Set} | |
*/ | |
function getPrimes (maxPrime) { | |
const sieve = new Map | |
const result = new Set |
This file contains hidden or 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
{ | |
"iterations": 100 | |
} |
This file contains hidden or 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
[ | |
{ | |
"key": "cmd+y", | |
"command": "redo", | |
"when": "editorTextFocus && !editorReadonly" | |
}, | |
{ | |
"key": "shift+alt+down", | |
"command": "" | |
}, |
NewerOlder