Question 472127
The formula for the sum of digits 1 through n = {{{ (1/2)*n*(n+1) }}}
The sum of the boxes looks like:
{{{ 4*20 + 4*19 + 4*18 }}}  . . . to {{{ 4*4 }}}
If the top layer was {{{ 4*1}}}, the answer would be
Sum = {{{ 4*(1/2)*20*21 }}}
But I want to subtract {{{ 4*3 + 4*2 + 4*1 }}} from this, so
Sum = {{{ 2*20*21 - 4*(1/2)*3*4 }}}
Sum = {{{ 2*20*21 - 2*3*4 }}}
Sum = {{{ 840 - 24 }}}
Sum = {{{ 816 }}}
In summation notation, this would look like:
4 x 1/2 x Sum, n from 1 to 20 of n
minus 4 x 1/2 x Sum, n from 1 to 3 of n