Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
zimpenfish
on Nov 1, 2023
|
parent
|
context
|
favorite
| on:
Rob Pike’s Rules of Programming (1989)
I think your `n * (n-1) / 2 + n` should be `n(n+1)(2n+1)/6` according to the SO article.
`n * (n-1) / 2 + n` would be the sum of numbers, not sum of squares.
eesmith
on Nov 2, 2023
[–]
Thank you for the correction!
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
`n * (n-1) / 2 + n` would be the sum of numbers, not sum of squares.