euler

Euler numbers, and Euler polynomials.

Category: Mathematics > Number Theory

Syntax

E = euler(n)

Euler number E_n.

E = euler(n, x)

Euler polynomial E_n(x).

Description

The Euler numbers are the integers 1, 0, -1, 0, 5, 0, -61, ... that appear in the series sech(x) = sum(E_n*x^n/n!). The signs alternate on the even indices and the magnitudes grow quickly.

The Euler polynomials satisfy E_n(x + 1) + E_n(x) = 2*x^n. They are different from the Euler numbers, which are not the same as Euler's constant e or the Euler-Mascheroni constant.

Input arguments

n
Nonnegative integer index, scalar or array.
x
Argument of the polynomial; number or symbolic variable.

Output arguments

E
The Euler number or polynomial value. The odd-index Euler numbers are zero.

Example

Numbers and a polynomial

euler(0:6)
syms x
euler(2, x)
Output
ans = 1×7

     1     0    -1     0     5     0   -61
ans = x^2 - x

See also

bernoulli fibonacci factorial sech