Q. If f(1)=2 and f(n)=−3f(n−1)+n then find the value of f(5).Answer:
Given f(1)=2: We are given that f(1)=2. To find f(5), we need to find the values of f(2), f(3), f(4), and then f(5) using the recursive formula f(n)=−3f(n−1)+n.
Find f(2): First, let's find f(2) using the formula:f(2)=−3f(2−1)+2f(2)=−3f(1)+2f(2)=−3(2)+2f(2)=−6+2f(2)=−4
Find f(3): Next, we find f(3) using the formula:f(3)=−3f(3−1)+3f(3)=−3f(2)+3f(3)=−3(−4)+3f(3)=12+3f(3)=15
Find f(4): Now, we find f(4) using the formula:f(4)=−3f(4−1)+4f(4)=−3f(3)+4f(4)=−3(15)+4f(4)=−45+4f(4)=−41
Find f(5): Finally, we find f(5) using the formula:f(5)=−3f(5−1)+5f(5)=−3f(4)+5f(5)=−3(−41)+5f(5)=123+5f(5)=128