To generate the sum of for i = 1 to n of (2 i - 1), reverse the numbers and add:
1 + 3 + 5 + 7 + ... + 2n-3 + 2n-1
+ 2n-1 + 2n-3 + 2n-5 + 2n-7 + ... + 3 + 1
----------------------------------------------
2n + 2n + 2n + 2n + ... + 2n + 2n
= 2n^2 but since the sum was added twice divide by 2 so
The sum of for i = 1 to n of (2 i - 1) = n^2.