A sequence {an}, when n is odd, an = 5N + 1, when n is even, an = 2 ^ (n A sequence {an}, when n is odd, an = 5N + 1, when n is even, an = 2 ^ (n / 2), find the sum of the first n terms of the sequence

A sequence {an}, when n is odd, an = 5N + 1, when n is even, an = 2 ^ (n A sequence {an}, when n is odd, an = 5N + 1, when n is even, an = 2 ^ (n / 2), find the sum of the first n terms of the sequence

When n = 2K
Sn = sum of the first k odd terms + sum of the first k even terms
=(1+5k+1)*k/2+2(1-2^k)/(1-2)=(5k+2)k/2+2(2^k-1)
When n = 2K + 1
Sn = sum of odd terms of first K + 1 + sum of even terms of first k
=(1+5(k+1)+1)*(k+1)/2+2(1-2^k)/(1-2)=(5k+7)(k+1)/2+2(2^k-1)