I have a semi-random math question. Does anyone know a closed form of SumL=1-n (SumK=1-n Max(L,K)) i.e. can that double sum be expressed as a function of n? Thanks in advance.
I'm assuming Max is a maximum function in which it will choose the bigger of the two variables. In the case they are equal, it will give either one (because they are the same) First Assume L=1. In that case, you have a summation from 1 to n. If L=2, you have a summation from 2 to n, plus 2. Get that in terms of summation from 1 to n. If L=3, you have the summation from 1 to n but with 1+2 in there at the beginning terms. ... If L=n, you have Sum(K=1 to n)K + Sum(i=1 to L-1)i Since it was a summation, add all the terms together... You will have n[Sum(K=1 to n)K] + Sum(L=1 to n)[Sum(i=1 to L-1)i] This is just (n^2)(n+1)/2 + Sum(L=1 to n)[(L-1)th triangle number] Which is (n^2)(n+1)/2 + Sum(the first n-1 triangle numbers) Which is (n^2)(n+1)/2 + (n-1)(n)(n+1)/6 Which is [4(n^3) + 3(n^2)-n]/6 I think that's right.