TCS
Company
In a sequence of integers , A(n)= A(n-1)-A(n-2), where A(n) is the nth term in the sequence, n is the integer and n>=3 , A(1)=1, A(2)=1,. calculate S(1000), where S(1000) is the sum of the first 1000 terms
Read Solution (Total 3)
-
- A(1)=1,
A(2)=1,
A(3)=A(2)-A(1)=0,
A(4)=A(3)-A(2)=-1,
A(5)=A(4)-A(3)=-1,
A(6)=A(5)-A(4)=-1-(-1)=0
AND SO ON...
1000/6=166 AND REMAINDER 4.
SO S(1000)=1+1+0-1= 1 (ANS) - 12 years agoHelpfull: Yes(5) No(11)
- ANS = 0
s(1000)= A(1)
+ A(2)
+ A(2)-A(1)
+ A(3)-A(2)
........
+ A(998)-A(997)
+ A(999)-A(998)
cross terms will cancel each other
=>s(1000)= A(2)+ A(999)
again by definition
A(n)= A(n-1)-A(n-2)= (A(n-2)-A(n-3)) - A(n-2)= -A(n-3)=A(n-5)
A(999)= A(994)=...=A(4)= -A(1)=-1
hence s(1000)=1+(-1)=0 - 12 years agoHelpfull: Yes(2) No(9)
- the series will repeat after ,a1 to a6 is (1 1 0 -1 -1 0) so the ans is -1
- 12 years agoHelpfull: Yes(2) No(7)
TCS Other Question