fun_rec_seq: Recursive Sequence Function

Description Usage Arguments Value Examples

View source: R/fun_rec_seq.R

Description

A recursive sequence where element n is the sum of element n-1 and the difference between elements n-2 and n-3 divided by n.

Usage

1

Arguments

x

Numeric vector containing the first three elements of the sequence.

n

Integer denoting the final nth element of the sequence.

Value

Returns element n.

Examples

1
2
3
fun_rec_seq(x = c(2, 4, 3), n = 3)
fun_rec_seq(x = c(2, 4, 3), n = 4)
fun_rec_seq(x = c(2, 4, 3), n = 5)

21Sp-STAT-413-613/hw04p.marc.estevadeordal documentation built on March 1, 2021, midnight