Number Series
It's important to understand how different number series can be interpreted and sum of the series is derived. This is necessary in general and specifically for big O calculations.
Here it's important to keep in mind that the value at each position can be derived from previous positions. This is exactly why the sum in the series is represented just using the last elements in most cases.
In all the sum series, the objective is to find the area based on the series. The sum in the sequence represents the sum of area created by each position.
Here N doesn't mean the value at the position. N means the position itself. Consider this for all N's in the below table.
Example in case of sum of odd numbers, the N in refers to the last position of the list.
| Number series / pattern | Formula / closed form | Why it appears in interviews |
|---|---|---|
| Arithmetic series | Iteratively adding a constant to each position. | |
| Sum of first N numbers | Counting loop iterations, triangular loops. Same as above. But adding 1 to each position. | |
| Sum of 1 through N−1 | Pair comparisons, nested loops. Same rectangle mental model. Just one layer less. | |
| Sum of odd numbers | Explains quadratic growth. Here 2N-1 is the value at each position. Eg., 2x1-1, 2x2-1. | |
| Sum of even numbers | Loops skipping by 2. Here 2N is the value at each position. Eg., 2x1, 2x2. | |
| Sum of powers of two | Trees, recursion trees, BFS/DFS | |
| Geometric series | Divide-and-conquer analysis | |
| Harmonic series | Amortized analysis (hashing, resizing) | |
| Average of 1 to N | ≈ | Expected value, amortized cost. Here we take sum of first value and the last value and take its average. |
| Powers of two | Binary structures, divide-and-conquer | |
| Number of pairs | Comparing all pairs. This is just the regular combinations formula. | |
| Number of subsets | Power set, bitmask problems | |
| Number of permutations | Backtracking, ordering problems |
In geometric series, the elements in the series are multiplied by a constant such that the shape/proportions are preserved.
Whereas in arithmetic series, a constant is only added to each element of the series.
Mental models for remembering formulae
Since the above formulas list is a long one, its necessary to have mental models that remains in memory forever.
Using geometry as the mental model will help us to remember the number series formulae.
Arithmetic Series

Geometric Series
Here each position in the series is proportional to the previous one. Since the base of the exponent is the variable here, the geometric size at each step depends both base and exponent.
It looks a bit confusing since we use mostly the to get the sum of all numbers until . This is because each term is multiplied by which makes the next term way bigger than previous one.
Another analogy is, every next term already contains all the parts of the previous series.
