Function Repository Resource:

# EisensteinFactorInteger

Factor an integer into powers of Eisenstein primes

Contributed by: Daniel Lichtblau
 ResourceFunction["EisensteinFactorInteger"][n] gives a list of the Eisenstein prime factors of n, together with their exponents. ResourceFunction["EisensteinFactorInteger"][n,ω] returns a result using ω to denote the Eisenstein unit .

## Details

Eisenstein integers are elements of the ring where is a primitive third root of unity.
The element defining the algebraic extension can also be written as .
The Eisenstein integers are the algebraic integers in the number field , which is sometimes referred to as the third cyclotomic field.
The result of ResourceFunction["EisensteinFactorInteger"] is unique up to multiplying factors by units (so the Eisenstein integers are a unique factorization domain).
The units in the ring of Eisenstein integers are {±1,±ω,±ω2}.
ResourceFunction["EisensteinFactorInteger"] initially factors its input into ordinary prime factors.
Integer primes of the form 6m+1, along with 3, can be further factored into a product of Eisenstein primes.
Integer primes of the form 6m-1 are also Eisenstein primes.
ResourceFunction["EisensteinFactorInteger"] will also factor rationals over the Eisenstein integers, using negative integer powers for the denominator factors.
ResourceFunction["EisensteinFactorInteger"] in effect solves the generalized Pell equation n=a2+3b2, using Cornacchia's algorithm.

## Examples

### Basic Examples (2)

Factor 171 over the Eisenstein integers:

 In[1]:=
 Out[1]=

Check the result:

 In[2]:=
 Out[2]=

### Scope (3)

Factor a rational over the Eisenstein integers:

 In[3]:=
 Out[3]=

Check the result:

 In[4]:=
 Out[4]=

Use a symbol to denote the Eisenstein unit :

 In[5]:=
 Out[5]=

Primes of the form 6k+1 factor further in the Eisenstein ring:

 In[6]:=
 Out[6]=

Primes of the form 6k-1 will not factor further:

 In[7]:=
 Out[7]=

### Possible Issues (1)

EisensteinFactorInteger does not attempt to factor non-integer elements in the Eisenstein ring:

 In[8]:=
 Out[8]=

### Neat Examples (12)

Factoring Eisenstein integers can be done as follows: (1) Compute the norm (an ordinary integer). (2) Factor the norm over the Eisenstein integers. (3) Use division to determine, for each pair of conjugate Eisenstein primes in the norm factorization, which divides the original Eisenstein integer. (4) Determine the correct exponent for each such factor. (5) Determine the appropriate Eisenstein unit that makes the factorization correct.

Step (3) requires modification when 3 divides the norm. The (4) involves a subtlety: Since different Eisenstein primes can have the same norm, one cannot assume that the exponents for prime factors in step (2) will be correct for the Eisenstein primes retained in step (3). We work with examples that have exponent of 1 and hence cannot exhibit this pathology.

Define the Eisenstein norm (n(i+jω)=i2-ij+j2):

 In[9]:=

Compute the norm of 8+17ω:

 In[10]:=
 Out[10]=

Factor the norm:

 In[11]:=
 Out[11]=

Use GroebnerBasis and PolynomialReduce to provide a divisibility test for Eisenstein integers:

 In[12]:=

Determine which Eisenstein prime factors of 129 are actually factors of 8+13ω:

 In[13]:=
 Out[13]=

Find the unit factor:

 In[14]:=
 Out[14]=

Check the factorization:

 In[15]:=
 Out[15]=

When 3 divides the norm, we can use either Eisenstein prime factor of 3 for our final result:

 In[16]:=
 Out[16]=

Compute the factors:

 In[17]:=
 Out[17]=

Compute the associated unit:

 In[18]:=
 Out[18]=

Check the result:

 In[19]:=
 Out[19]=

Show that we get an equally valid prime factorization from using the other prime factor of 3:

 In[20]:=
 Out[20]=

A full implementation that properly handles all the steps indicated above may be found in the much larger resource function EisentsteinIntegers.

## Version History

• 1.0.0 – 05 April 2021