Math Fundamentals18 sections · 814 units
Open in Course

Arithmetic Slices - Counting Insight

How many slices in a sequence

If you have an arithmetic sequence of length kk (where k3k \geq 3), how many arithmetic subarrays does it contain?

For k=3k = 3: just 11 (the whole sequence). For k=4k = 4: 33 subarrays (length 3 at positions 0-2 and 1-3, plus length 4). For k=5k = 5: 66 subarrays.

The pattern: 1,3,6,10,...1, 3, 6, 10, ..., which is 1+2+3+...+(k2)=(k2)(k1)21 + 2 + 3 + ... + (k-2) = \frac{(k-2)(k-1)}{2}. This is a summation formula in disguise.