title: Calculating item offset for pagination
body: <p>this seems like very simple maths but somehow, my brain cant think ... </p>
  
  <p>i am trying to implement pagination and will need to calculate the item offset to use in limiting my result set. i am having problems calculating what index the first item of the page should have. </p>
  
  <p>eg. </p>
  
  <pre><code>with 1 page having 10 items
  
  page 1 will have items 1 - 10
  page 2 ............... 11 - 20
  page 3 ............... 21 - 30
  </code></pre>
  
  <p>i thought of</p>
  
  <pre><code>offset = page * itemsPerPage + 1
  </code></pre>
  
  <p>but this will not be the case for page 1. there must be a formula for this? am using PHP/Zend_Paginator/Doctrine2 but this should be language independent </p>
  
  <p><em>wonder if this should be in the the maths stack exchange site</em> </p>