REDUCE

7.4 Bernoulli, Euler and Fibonacci Numbers

Bernoulli numbers are provided by the unary operator Bernoulli. If \(n\) is a non-negative integer, the call Bernoulli(n) evaluates to the \(n\)th Bernoulli number; all of the odd Bernoulli numbers, except Bernoulli(1), are zero. Otherwise the result involves the original operator Bernoulli; on graphical interfaces this is rendered as \(\mathrm {B}_n\).

Euler numbers are computed by the unary operator Euler. If \(n\) is a non-negative integer, the call Euler(n) returns the \(n\)th Euler number; all of the odd Euler numbers are zero. Otherwise the result returned involves the original operator Euler; on graphical interfaces this is rendered as \(\mathrm {E}_n\).

Fibonacci numbers are provided by the unary operator Fibonacci, where Fibonacci(n) evaluates to the \(n\)th Fibonacci number; if \(n\) is an integer, this will be evaluated following the recursive deļ¬nition: \[F_0 = 0; \qquad F_1 = 1;\qquad F_n = F_{n-1} + F_{n-2}\,.\] The recursion is, of course, optimised as a simple loop to avoid repeated computation of lower-order numbers. Otherwise the result returned involves the original operator fibonacci; on graphical interfaces this is rendered as \(\mathrm {F}_n\).


Hosted by Download REDUCE Powered by MathJax