Finite: a(1 - r^n)/(1 - r). Infinite with |r| < 1: a/(1 - r).
The most reused formula in quant interviews after 1/p. It gives the present value of a perpetuity, the expectation of a geometric distribution, and the value of an infinitely repeated game.
The derivative trick worth knowing: differentiating the sum formula with respect to r gives sums like the sum of n r^n, which is how the variance of a geometric distribution and several expected-value questions are derived without heavy algebra.