GeomSn: Geometric Series

Description Usage Arguments Value Author(s) See Also Examples

View source: R/DescTools.r

Description

A geometric sequence is a sequence, such that each term is given by a multiple of q of the previous one. A geometric series consists out of the sum of all former values of a geometric sequence..

Usage

1
GeomSn(a1, q, n)

Arguments

a1

the first element of the sequence

q

the factor of the sequence

n

number of elements to include in the sum

Value

the sum as numeric value

Author(s)

Andri Signorell <andri@signorell.net>

See Also

sum

Examples

1
2
3
4
5
6
7
GeomSn(a1=3, q=2, n=5)

# calculates the sum of the first 5 elements of the sequence
(gseq <- 3 * (2^(0:5)))
sum(gseq)

GeomSn(a1=3, q=2, n=0:5)

DescTools documentation built on June 17, 2021, 5:12 p.m.