Find a closed form, in terms of n, for the number of times S is executed in the following algorithms:
i=n; while i≥0 do j=0; while (j<i) do S; j:=j+2; od i:=i-2; od