Are Coprime - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


NumberTheory

  

AreCoprime

  

test whether a sequence of numbers is relatively prime

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

AreCoprime(x1, x2, ..., xn)

AreCoprime(x1, x2, ..., xn, domain_opt)

Parameters

x1, x2, ..., xn

-

sequence of integers or Gaussian integers

domain_opt

-

(optional) an equation of the form domain = integer, domain = GaussInt, or domain = gaussian; the default is domain = integer

Description

• 

The AreCoprime function tests whether a sequence of numbers is relatively prime in a given domain. A sequence of numbers are relatively prime (or coprime) if the greatest common divisor of the numbers is equal to 1.

• 

By default, the test is performed in the integer domain (that is, domain = integer). To test whether a sequence of Gaussian integers is relatively prime, use either domain = GaussInt or domain = gaussian for domain_opt.

Examples

The AreCoprime function tests if the greatest common divisor of a sequence of numbers is 1 or not. (The igcd function returns the greatest common divisor of a sequence of numbers.)

(1)

(2)

(3)

(4)

The domain_opt option can be used to specify the domain. In the following examples, the domain is the Gaussian integers. (The GaussInt:-GIgcd command returns the greatest common divisor of a sequence of Gaussian integers.)

(5)

(6)

(7)

(8)

The following visualizes the coprimes for the first fifteen integers in dark red:

Compatibility

• 

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

• 

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

See Also

GaussInt

GaussInt[GIgcd]

igcd

NumberTheory

NumberTheory[InverseTotient]

NumberTheory[Totient]

 


Download Help Document