numlib::phi -- Euler phi
function, Euler totient function
Introductionnumlib::phi(n) calculates the Euler
phi function of n.
Call(s)numlib::phi(n)
Parametersn |
- | integer not equal to zero |
Returnsnumlib::phi returns a positive integer, if the argument
evaluates to an integer unequal zero. If the argument cannot be
evaluate to a number, the function call with evaluated arguments is
returned .
n
Related
Functions
Detailsnumlib::phi(n) calculates the Euler
phi function of the argument n, i.e. the number
of numbers smaller than |n| which are relatively prime to
n. Cf. Example 1.numlib::phi returns an error if the argument is a
number but not an integer unequal to zero.numlib::phi returns the function call with evaluated
arguments if the argument is not a number. Cf. Example 2.
Example
1numlib::phi works on integers unequal
zero:
>> numlib::phi(-7), numlib::phi(10)
6, 4
Example
2numlib::phi is returned as a function call
with evaluated argument:
>> x := a: numlib::phi(x)
numlib::phi(a)
phi