ArithProg: Returns a numeric vector whose elements follow an arithmetic...

View source: R/ArithProg.R

ArithProgR Documentation

Returns a numeric vector whose elements follow an arithmetic progression

Description

The function generates a sequence of numbers, S_k, which follow an arithmetic progression as shown below.

S_k = S_1 + (k - 1)d

Usage

ArithProg(st=0, n, d)

Arguments

st

The term, S_1, starting point of your arithmetic progression. Defaults to zero.

n

Defines the no. of terms in the progression.

d

Denotes the difference term, d = S_{k+1} - S_k, between consecutive terms of the progression.

Value

The return type of the function is always a vector containing S_k,\,\,\, \forall k \in [1, n]

Author(s)

Chitran Ghosal

Examples

rm(list=ls())
v1 <- ArithProg(n=3,d=3)
v1

v2 <- ArithProg(st=11, n=10,d=3)
v2


Chitran1987/StatsChitran documentation built on Feb. 23, 2025, 8:30 p.m.