by substack · 14y ago · 0 comments
function sum (m, n) {
return m * (m + 1) / 2 - n * (n - 1) / 2
}
I only know this because I remember from math competitions in high school learning that you can compute the sum of the digits from 1 to n quickly from `n * (n + 1) / 2` which naturally follows from the equations regarding binomial sums.This example somewhat agrees with the author's main point that we are more a product of our experiences than endowed with certain innate capabilities.
No comments yet.