Function Repository Resource:

# FactorGraph

Get a graph representation for the factorization of an integer

Contributed by: Emmanuel Garcés
 ResourceFunction["FactorGraph"][n] gives a graph representing the factorization of the integer n. ResourceFunction["FactorGraph"][n,pos] gives the graph for n with the largest factor with position pos that can be "Inside" or "Outside".

## Details and Options

Let m and n be distinct integers such that m divides n. Then the vertices of a polygon with n vertices can be connected to a polygon with m vertices from m/n equally spaced vertices on the first polygon. This procedure can be applied repeatedly to the prime factors of a number in order to get visualizations of the factorizations of the numbers.
The vertices of a polygon with vertices can be connected to a polygon with vertices from equally spaced vertices on the first polygon. This procedure can be applied repeatedly to the prime factors of a number in order to get visualizations of the factorizations of the numbers.

## Examples

### Basic Examples

Get the rules representing the graph:

 In[1]:=
 Out[1]=
 In[2]:=
 Out[2]=

Get the graph:

 In[3]:=
 Out[3]=

Factor graphs from a list of the first 10 integers:

 In[4]:=
 Out[4]=

With a different method:

 In[5]:=
 Out[5]=

For a larger integer:

 In[6]:=
 Out[6]=

## Requirements

Wolfram Language 11.3 (March 2018) or above