Function Repository Resource:

# CommonDivisors (5.0.0)current version: 6.0.0 »

Find the common divisors of two or more integers

Contributed by: Wolfram|Alpha Math Team
 ResourceFunction["CommonDivisors"][{n1,n2,…}] gives the common divisors of the integers ni. ResourceFunction["CommonDivisors"][n] gives the integer divisors of an integer n.

## Details and Options

ResourceFunction["CommonDivisors"] works only with integers and Gaussian integers.
The input to ResourceFunction["CommonDivisors"] must be exact, not approximate, numbers.

## Examples

### Basic Examples (2)

Find the common divisors of a list of integers:

 In[1]:=
 Out[1]=

Find the divisors of a single integer:

 In[2]:=
 Out[2]=

### Scope (2)

Find the common divisors of a list of powers:

 In[3]:=
 Out[3]=

CommonDivisors can handle Gaussian integers:

 In[4]:=
 Out[4]=

### Applications (1)

Make a table showing that the first five primes share no proper common divisors other than 1:

 In[5]:=
 Out[5]=
 In[6]:=
 Out[6]=

### Possible Issues (1)

The input to CommonDivisors must consist of exact, not approximate, numbers:

 In[7]:=
 Out[7]=

## Publisher

Wolfram|Alpha Math Team

## Version History

• 6.0.0 – 23 March 2023
• 5.0.0 – 16 April 2020
• 4.0.0 – 16 April 2020
• 3.0.0 – 24 January 2020
• 2.0.0 – 06 September 2019
• 1.0.0 – 23 July 2019

## Author Notes

To view the full source code for CommonDivisors, evaluate the following:

 In[1]:=