Learn R Programming

boostmath (version 1.0.0)

number_series: Number Series

Description

Functions to compute Bernoulli numbers, tangent numbers, fibonacci numbers, and prime numbers.

Usage

bernoulli_b2n(n = NULL, start_index = NULL, number_of_bernoullis_b2n = NULL)

max_bernoulli_b2n()

unchecked_bernoulli_b2n(n)

tangent_t2n(n = NULL, start_index = NULL, number_of_tangent_t2n = NULL)

prime(n)

max_prime()

fibonacci(n)

unchecked_fibonacci(n)

Value

A single numeric value for the Bernoulli numbers, tangent numbers, fibonacci numbers, or prime numbers, or a vector of values for ranges.

Arguments

n

Index of number to compute (must be a non-negative integer)

start_index

The starting index for the range of numbers (must be a non-negative integer)

number_of_bernoullis_b2n

The number of Bernoulli numbers to compute

number_of_tangent_t2n

The number of tangent numbers to compute

Details

Efficient computation of Bernoulli numbers, tangent numbers, fibonacci numbers, and prime numbers.

The checked_ functions ensure that the input is within valid bounds, while the unchecked_ functions do not perform such checks, allowing for potentially faster computation at the risk of overflow or invalid input.

The range_ functions allow for computing a sequence of numbers starting from a specified index.

The max_ functions return the maximum index for which the respective numbers can be computed using precomputed lookup tables.

See Also

Boost Documentation for more details on the mathematical background.

Examples

Run this code
bernoulli_b2n(10)
max_bernoulli_b2n()
unchecked_bernoulli_b2n(10)
bernoulli_b2n(start_index = 0, number_of_bernoullis_b2n = 10)
tangent_t2n(10)
tangent_t2n(start_index = 0, number_of_tangent_t2n = 10)
prime(10)
max_prime()
fibonacci(10)
unchecked_fibonacci(10)

Run the code above in your browser using DataLab