What is the formula of the sum of the first n terms of an equal ratio sequence?

What is the formula of the sum of the first n terms of an equal ratio sequence?

There are two cases
1. Sn = Na1 when common ratio q = 1
2. Sn = A1 (1-Q ^ n) / (1-Q) when common ratio q is not equal to 1