Let V be an upper triangular matrix and W a lower triangular matrix, both square with n lines. Find the number of multiplications and additions performed to calculate the product VW.
When I multiply the first line of V by the cols of W I have
$$m = n; n-1; n-2; ... ; 1 = n^2-(n-1)!\\ a = n-1; n-1; n-3;...;0 = n^2-n!$$
For the second line
$$m = n-1; n-2; ...; 1 = n^2-(n-1)!\\ a = n-2; n-3; n-4;...;0 = n^2-n!$$
In total:
$$m = (n^2-(n-1)!)n \\ a = (n^2-n!)n$$
Is this correct?
With $V$ you have $v_{ij}=0$ if $i\gt j$. With $W$ you have $w_{ij}=0$ if $i\lt j$.
If $VW=Z$, then $$z_{ij}=\sum_{k=1}^n v_{ik}w_{kj}.$$ But whenever $k\lt \min(i,j)$, the summand is $0$. So the sum is really $$z_{ij}=\sum_{k=\min(i,j)}^n v_{ik}w_{kj}.$$ This is $n+1-\min(i,j)$ products, and $n-\min(i,j)$ sums.
So you want to calculate $$\sum_{i=1}^n\sum_{j=1}^n (n+1)-\min(i,j).$$ And this in turn means calculating $$\sum_{i=1}^n\sum_{j=1}^n \min(i,j).$$ This sum is $$1(n) + 2(n-1) + 3(n-2)+\cdots +n(1).$$ The calculation of the number of sums is going to likewise turn on this sum.