title: Number of ways such that sum of k elements equal to p
body: <p>Given series of integers having relation where a number is equal to sum of previous 2 numbers and starting integer is 1</p>
  
  <blockquote>
    <p>Series ->1,2,3,5,8,13,21,34,55</p>
  </blockquote>
  
  <p>find the number of ways such that sum of k elements equal to p.We can use an element any number of times.</p>
  
  <blockquote>
    <p>p=8</p>
    
    <p>k=4.</p>
  </blockquote>
  
  <p><strong>So,number of ways would be 4.Those are,</strong></p>
  
  <blockquote>
    <p>1,1,1,5</p>
    
    <p>1,1,3,3</p>
    
    <p>1,2,2,3</p>
    
    <p>2,2,2,2</p>
  </blockquote>
  
  <p>I am able to sove this question through recursion.I sense dynamic programming here but i am not getting how to do it.Can it be done in much lesser time???</p>
  
  <p><strong>EDIT</strong> I forgot to mention that the sequence of the numbers does not matter and will be counted once. for ex=3->(1,2)and(2,1).here number of ways would be 1 only.</p>