sum 0..M = 3 sum 0..(M+1) = 6