an = (2n-1)(1/4)^n
= n(1/4)^(n-1) - (1/4)^n
Sn =a1+a2+..+an
= [summation(i:1->n){i(1/4)^(i-1)} ] - (1/3)(1- (1/4)^n)
consider
[x^(n+1)-1]/(x-1) = 1+x+x^2+...+x^n
[(x^(n+1)-1)/(x-1)]' = 1+2x+..+nx^(n-1)
1+2x+..+nx^(n-1) = [nx^(n+1)-(n+1)x^n+1]/(x-1)^2
put x=1/4
[summation(i:1->n){i(1/4)^(i-1)} ]
=1(1/4)^0 + 1(1/4)^1+..+n(1/4)^(n-1)
= (16/9)[n.(1/4)^(n+1)-(n+1).(1/4)^n +1 ]
= (16/9) - (4/9)(n+2)(1/4)^n
Sn = [summation(i:1->n){i(1/4)^(i-1)} ] - (1/3)(1- (1/4)^n)
= (16/9) - (4/9)(n+2)(1/4)^n - (1/3)(1- (1/4)^n)
= 13/9 - (1/9)( 4n+5)(1/4)^n .