title: Calculate sum sequence by sequence
body: <p>Suppose I have a data.table </p>
  
  <pre><code>data.table(A=c(1,2,3,4,5,6,4,2))
  </code></pre>
  
  <p>How can I calculate the sum of a sequences of <code>n</code> elements?</p>
  
  <p>Suppose <code>n=3</code>, The result of the sequence sum of A should be the column <code>seq_sum</code>,</p>
  
  <pre><code>data.table(A=c(1,2,3,4,5,6,4,2),seq_sum=c(1+2+3,2+3+4,3+4+5,4+5+6,5+6+4,6+4+2,4+2,2))
  </code></pre>
  
  <p>How to effectively do this?</p>