Created
August 6, 2024 12:33
-
-
Save joemaffei/8fff0d435fc2a92b55d9d67426be8fc3 to your computer and use it in GitHub Desktop.
Sum of Squares
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
function squares(n: number) { | |
return (n * (n + 1) * (2 * n + 1)) / 6; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment