title: Generating Padovan Sequence
body: <p>The Padovan sequence is governed by the relationship P(n+1) = P(n-1) + P(n-2), for n is a
  non-negative integer, where P(0) = P(1) = P(2) = 1. So, for instance, P(3) = 2, P(4) = 2, and
  P (5) = 3, and so on.</p>
  
  <p>I want to write a Python program Pad(n) that generates the sequence P(0), P(1), ..., P(n - 1).</p>
  
  <p>This is what I have this far, but it only produces a list with the ith number replicated up to the largest number in the sequence:</p>
  
  <pre><code>def ith(n):
  
      first, sec, third, fourth = 1, 1, 1, 1
      for i in range(3, n+1):
          fourth = first + sec
          first = sec
          sec = third
          third = fourth
  
      return fourth
  
  
  
  def pad(n):
      pad = ith(n)
      lst = []
      for i in range(n):
          lst.append(pad)
  
      return lst
  </code></pre>
  
  <p>I want it to produce this as an output:</p>
  
  <pre><code>&gt;&gt;&gt; Pad(6)
  &gt;&gt;&gt;[1,1,1,2,2,3]
  </code></pre>
  
  <p>Currently my code only produces:</p>
  
  <pre><code>&gt;&gt;&gt;[4,4,4,4,4,4]
  </code></pre>
  
  <p>I now that I append the ith value ith number of times to the list, but I dont know how to append each number in series up to and including the value for the last number. Pad(6) yields 4 since this is all the previous relationships put together.</p>
  
  <p>Sorry for my bad description and formulating of the problem.</p>