Skip to content

Instantly share code, notes, and snippets.

@joemaffei
Created August 6, 2024 12:33
Show Gist options
  • Save joemaffei/8fff0d435fc2a92b55d9d67426be8fc3 to your computer and use it in GitHub Desktop.
Save joemaffei/8fff0d435fc2a92b55d9d67426be8fc3 to your computer and use it in GitHub Desktop.
Sum of Squares
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