Define the sequence An as:
n, if n is odd
An = 0, if n = 4t-2
1, if n = 4t
whenever t is a positive integer.
Derive a one-line expression for each of the following:
(i)
An in terms of n
(ii)
Sn in terms of n, where
Sn denotes the sum of all the terms of
An
The n-th term:
a(n)=n* KD(n mod2,1) + KD(n mod4,0)
**for definition of KD(Kronecker delta) see:
http://reference.wolfram.com/mathematica/ref/KroneckerDelta.html
Checking:
a(17)=17
a(18)=0
a(19)=19
a(20)=1
And the sum of n terms is:
S(n)=Sum(a(1) to a(n)))= INT((N+1)/2)^2+ INT(N/4) <br>
Checking: S(11)=6^2+2=38
1+0+3+1+5+0+7+1+9+0+11=38
Edited on September 20, 2013, 3:31 pm