1.

Let p(n) denotes the number of different ways the positive integer n(ngt1) can be expressed as the sum of 1's and 2's . For example P(5)=8,i-e i.e. 5=1+1+1+1+1 =1+1+1+2=1+1+2+1=1+2+1+1=2+1+1+1 =1+2+2=2+1+2=2+2+1 The value of p(p(6)) is

Answer»

<P>356
377
389
427

Solution :`p(N)=p(n-1)+p(n-2)`


Discussion

No Comment Found

Related InterviewSolutions