Totient Function - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Number Theory : Totient Function

NumberTheory

  

Totient

  

Euler's totient function

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

Totient(n)

 

phi(n)

φ⁡n

varphi(n)

ϕ⁡n

Parameters

n

-

positive integer

Description

• 

The Totient function computes Euler's totient function.

• 

Given a positive integer n, Totient(n) returns the number of positive integers coprime to n and not greater than n.

• 

phi and varphi are aliases of Totient.

• 

You can enter the commands phi and varphi using either the 1-D or 2-D calling sequence. For example, phi(8) is equivalent to φ⁡8, and varphi(8) is equivalent to ϕ⁡8.

Examples

> 

with⁡NumberTheory:

> 

Totient⁡1,φ⁡2,ϕ⁡3

1,1,2

(1)

If two integers n and m are coprime, then Totient(n)*Totient(m) = Totient(m*n). That is, the totient function is multiplicative.

> 

Totient⁡44⁢Totient⁡79,Totient⁡44⋅79

1560,1560

(2)
> 

andmap⁡i↦igcd⁡i1,i2≠1xorφ⁡i1⋅i2=φ⁡i1⋅φ⁡i2,seq⁡seq⁡i,j,j=1..100,i=1..100

true

(3)

The totient of any prime p is equal to p-1.

> 

Totient⁡59,Totient⁡101

58,100

(4)
> 

andmap⁡i↦ithprime⁡i−1=ϕ⁡ithprime⁡i,seq⁡1..100

true

(5)

The following command plots the values of Totient(n) for n from 2 to 1000.

> 

plots:-pointplot⁡seq⁡n,Totient⁡n,n=2..1000,labels=n,φ⁡n,color=Niagara BlueGreen,symbol=circle

Compatibility

• 

The NumberTheory[Totient] command was introduced in Maple 2016.

• 

For more information on Maple 2016 changes, see Updates in Maple 2016.

See Also

NumberTheory

NumberTheory[InverseTotient]