Created
December 17, 2021 10:23
-
-
Save davidsharp/eeb1e6e1a060ace3a16c3e7706fbaf3e to your computer and use it in GitHub Desktop.
Finds triangular number (or x + x-1 + x-2, etc down to 0)
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 fn = x => x + (x * ((x-1)/2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment