Sorry for all the posts, trying to prepare for upcoming algorithms course. Again, I am to determine the number of iterations given this code. So I looked at the solution and this table was provided which listed all the indices.ASSUME N is odd.How exactly do the come up with n-1/2 and n+1/2 in the table??Its seems like on n-1th iteration, we should subsitute n-1 for i and get ((n-1)+1)/2.

the solution is

2(1+2+3+....(n-1)/2)) + (n+1)/2

everything in the solution makes sense to me except how the come up with those last two terms