Doubt regarding the formula used in the video

If I use the formula given (j-i+1)*(j-i+2)/2 the answer is 6 for a window of size 3 while actually the value should be 10