geometric progression sum formula code example Example: geometric progression sum to infinity sum to infintiy = a1/1-r