number_series: Number Series

number_seriesR Documentation

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)

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 max_ functions return the maximum index for which the respective numbers can be computed using precomputed lookup tables.

Value

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

See Also

Boost Documentation for more details on the mathematical background.

Examples

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)

boostmath documentation built on Dec. 15, 2025, 5:07 p.m.