Returns a rational number, which is an approximation of the n'th Bernoulli
number for integer n. burn exploits the observation that
(rational) Bernoulli numbers can be approximated by (transcendental) zetas with
tolerable efficiency:

burn may be more efficient than bern for large, isolated n
as bern computes all the Bernoulli numbers up to index n before
returning. burn invokes the approximation for even integers n >
255. For odd integers and n <= 255 the function bern is called.

Computes a continued fraction approximation.
expr is an expression comprising continued fractions,
square roots of integers, and literal real numbers
(integers, rational numbers, ordinary floats, and bigfloats).
cf computes exact expansions for rational numbers,
but expansions are truncated at ratepsilon for ordinary floats
and 10^(-fpprec) for bigfloats.

Operands in the expression may be combined with arithmetic operators.
Maxima does not know about operations on continued fractions
outside of cf.

cf evaluates its arguments after binding listarith to
false. cf returns a continued fraction, represented as a list.

A continued fraction a + 1/(b + 1/(c + ...)) is represented by the list
[a, b, c, ...]. The list elements a, b, c, …
must evaluate to integers. expr may also contain sqrt (n) where
n is an integer. In this case cf will give as many terms of the
continued fraction as the value of the variable cflength times the
period.

A continued fraction can be evaluated to a number by evaluating the arithmetic
representation returned by cfdisrep. See also cfexpand for
another way to evaluate a continued fraction.

See also cfdisrep, cfexpand, and cflength.

Examples:

expr is an expression comprising continued fractions and square roots of
integers.

Controls the value returned by ifactors. The default false
causes ifactors to provide information about multiplicities of the
computed prime factors. If factors_only is set to true,
ifactors returns nothing more than a list of prime factors.

For a positive integer n returns the factorization of n. If
n=p1^e1..pk^nk is the decomposition of n into prime
factors, ifactors returns [[p1, e1], ... , [pk, ek]].

Factorization methods used are trial divisions by primes up to 9973,
Pollard's rho and p-1 method and elliptic curves.

The value returned by ifactors is controlled by the option variable factors_only.
The default false causes ifactors to provide information about
the multiplicities of the computed prime factors. If factors_only
is set to true, ifactors simply returns the list of
prime factors.

After calling lucas, the global variable
next_lucas is equal to lucas (n + 1),
the Lucas number following the last returned. The example shows
how Fibonacci numbers can be computed via lucas and next_lucas.

If x and y are real numbers and y is nonzero, return
x - y * floor(x / y). Further for all real
x, we have mod (x, 0) = x. For a discussion of the
definition mod (x, 0) = x, see Section 3.4, of
"Concrete Mathematics," by Graham, Knuth, and Patashnik. The function
mod (x, 1) is a sawtooth function with period 1 with
mod (1, 1) = 0 and mod (0, 1) = 0.

To find the principal argument (a number in the interval (-%pi, %pi]) of
a complex number, use the function
x |-> %pi - mod (%pi - x, 2*%pi), where x is an
argument.

When x and y are constant expressions (10 * %pi, for
example), mod uses the same big float evaluation scheme that floor
and ceiling uses. Again, it's possible, although unlikely, that
mod could return an erroneous value in such cases.

Expands the expression expr in partial fractions
with respect to the main variable var. partfrac does a complete
partial fraction decomposition. The algorithm employed is based on
the fact that the denominators of the partial fraction expansion (the
factors of the original denominator) are relatively prime. The
numerators can be written as linear combinations of denominators, and
the expansion falls out.

Primality test. If primep (n) returns false, n is a
composite number and if it returns true, n is a prime number
with very high probability.

For n less than 341550071728321 a deterministic version of
Miller-Rabin's test is used. If primep (n) returns
true, then n is a prime number.

For n bigger than 341550071728321 primep uses
primep_number_of_tests Miller-Rabin's pseudo-primality tests and one
Lucas pseudo-primality test. The probability that a non-prime n will
pass one Miller-Rabin test is less than 1/4. Using the default value 25 for
primep_number_of_tests, the probability of n beeing
composite is much smaller that 10^-15.

Returns the Riemann zeta function. If n is a negative integer, 0, or a
positive even integer, the Riemann zeta function simplifies to an exact value.
For a positive even integer the option variable zeta%pi has to be
true in addition (See zeta%pi). For a floating point or bigfloat
number the Riemann zeta function is evaluated numerically. Maxima returns a
noun form zeta (n) for all other arguments, including rational
noninteger, and complex arguments, or for even integers, if zeta%pi has
the value false.

zeta(1) is undefined, but Maxima knows the limit
limit(zeta(x), x, 1) from above and below.

The Riemann zeta function distributes over lists, matrices, and equations.

Computes the discrete logarithm. Let (Z/nZ)* be a cyclic group, g a
primitive root modulo n and let a be a member of this group.
zn_log (a, g, n) then solves the congruence g^x = a mod n.

The applied algorithm needs a prime factorization of totient(n). This factorization
might be time consuming as well and in some cases it can be useful to factor first
and then to pass the list of factors to zn_log as the fourth argument.
The list must be of the same form as the list returned by ifactors(totient(n))
using the default option factors_only : false.

The algorithm uses a Pohlig-Hellman-reduction and Pollard's Rho-method for
discrete logarithms. The run time of zn_log primarily depends on the
bitlength of the totient's greatest prime factor.

Returns the order of x if it is a unit of the finite group (Z/nZ)*
or returns false. x is a unit modulo n if it is coprime to n.

The applied algorithm needs a prime factorization of totient(n). This factorization
might be time consuming in some cases and it can be useful to factor first
and then to pass the list of factors to zn_log as the third argument.
The list must be of the same form as the list returned by ifactors(totient(n))
using the default option factors_only : false.

Without the optional argument allzn_power_table(n)
shows a power table of all elements in (Z/nZ)*
which are all elements invertible modulo n.
The exponent loops from 1 to the greatest characteristic factor of
totient(n) and the table ends with a column of ones on the right side.

The optional argument all causes the table to be printed for all
non-zero elements. The exponent now loops from 1 to
totient(n) + 1 and in case the modulus factors into different primes
the last column is equal to the first.

If the multiplicative group (Z/nZ)* is cyclic, zn_primroot computes the
smallest primitive root modulo n. (Z/nZ)* is cyclic if n is equal to
2, 4, p^k or 2*p^k, where p is prime and
greater than 2 and k is a natural number. zn_primroot
performs an according pretest if the option variable zn_primroot_pretest
(default: false) is set to true. In any case the computation is limited
by the upper bound zn_primroot_limit.

If (Z/nZ)* is not cyclic or if there is no primitive root up to
zn_primroot_limit, zn_primroot returns false.

The applied algorithm needs a prime factorization of totient(n). This factorization
might be time consuming in some cases and it can be useful to factor first
and then to pass the list of factors to zn_log as an additional argument.
The list must be of the same form as the list returned by ifactors(totient(n))
using the default option factors_only : false.

If zn_primroot cannot find a primitve root, it stops at this upper bound.
If the option variable zn_primroot_verbose (default: false) is
set to true, a message will be printed when zn_primroot_limit is reached.

Checks whether x is a primitive root in the multiplicative group (Z/nZ)*.

The applied algorithm needs a prime factorization of totient(n). This factorization
might be time consuming and in case zn_primroot_p will be consecutively
applied to a list of candidates it can be useful to factor first and then to
pass the list of factors to zn_log as a third argument.
The list must be of the same form as the list returned by ifactors(totient(n))
using the default option factors_only : false.

The multiplicative group (Z/nZ)* is cyclic if n is equal to
2, 4, p^k or 2*p^k, where p is prime and
greater than 2 and k is a natural number.

zn_primroot_pretest controls whether zn_primroot will check
if one of these cases occur before it computes the smallest primitive root.
Only if zn_primroot_pretest is set to true this pretest will be
performed.