# Code

Since Javascript is open sourse, look at the source of the following Javascript animations.
 Most of the graphs can be generated with the following Mathematica procedure which allows to study a set of transformations T generating a monoid of transformations on R. This general code does not assume R to be a ring of integers. ```NaturalGraph[R_,T_]:=Module[{VV=R,EE,r=Length[R],t=Length[T]}, EE=Union[Flatten[Table[y=T[[k]][R[[j]]];If[R[[j]]==y,{},R[[j]]->y],{j,r},{k,t}]]]; UndirectedGraph[Graph[VV,EE]]]; NaturalGraph[Range[10]-1,{Function[x,Mod[x^2+1,10]],Function[x,Mod[x^2+3,10]]}] ```
We can for example directly work with an algebraic field extension over a finite field like F4:
```alpha=Root[#^2+#-1&,2];p=2;
R=Flatten[Table[AlgebraicNumber[alpha,{k,l}],{k,0,p-1},{l,0,p-1}]];
mod[x_]:=If[Length[x]>1,AlgebraicNumber[alpha,Mod[x[[2]],p]],Mod[x,p]];
T={Function[x,mod[x*x+1]]};
NaturalGraph[R,T]
```

Here is code to some statistical problems formulated in this paper. The problems could be harder to solve. Quadratic Graph problems [Mathematica] .

## The Graph Mandelbrot problems

We formulated some open questions which we believe to be accessible. I don't know the answers. Just to compare: examples of unreasonable problems are to find the fraction of graphs on Zn^* generated by T(x)=x2 which are connected, or the Fermat problem whether there is a sixth graph generated by T(x)=x2 on Zn which is connected. The first is equivalent to an Artin conjecture would tell that it is the Artin constant Productp prime (1-1/p(p-1)), in the second case it is the question whether larger Fermat primes exist. These are both infamous and possibly difficult problems.

Here is code which illustrate the Graph Mandelbrot problems. Mathematica Notebook.
```Mandelbrot1[n_,a_,b_]:=NaturalGraph[Range[n]-1,{Function[x,Mod[a x + b,n]]}];
S=Mandelbrot1[100,2,3];

Mandelbrot2[n_]:=NaturalGraph[Range[n]-1,{Function[x,Mod[3x+1,n]],Function[x,Mod[2x,n]]}];
S=Mandelbrot2[100];

Mandelbrot3[n_,a_,b_]:=NaturalGraph[Range[n-1],{Function[x,Mod[x^a,n]],Function[x,Mod[x^b,n]]}];
S=Mandelbrot3[257,5,56];

Mandelbrot4[n_,A_]:=NaturalGraph[Map[(Partition[#,2] &),Tuples[Range[n]-1,4]],{Function[x,Mod[x.x+A,n]]}];
S=Mandelbrot4[3,{{1,2},{2,4}}];

Mandelbrot5[n_,a_,b_]:=NaturalGraph[Tuples[{1,0},n],
{Function[x,CellularAutomaton[a,x]],Function[x,CellularAutomaton[b,x]]}];
S=Mandelbrot5[8,2,110]; GraphPlot[S]
```

Mathematica