For the following algorithm find the number of times the assignment statement (:=) is executed during the running of the program. Answer the question by giving a formula in terms of n:
i := 1;
while i < n + 1 do
i := i + 2;
for j := 1 to i do S od
od