Prime numbers in elementary cellular automata rule 110​
​by Daniel de Souza Carvalho
Starting with the value 1 as initial condition, we can view the pattern from the Elementary Cellular Automata rule 110, the first 100 steps
CellularAutomaton[110,{{1},0},100]//ArrayPlot
Out[]=
View the first 1,000 steps...
CellularAutomaton[110,{{1},0},1000]//ArrayPlot[#,PixelConstrained1,Frame->None,ImageSizeLarge]&
Out[]=
Here it is the rule 110 plot, black cells value is 1 and white cells is 0:
RulePlot[CellularAutomaton[110]]
Out[]=
We can convert each CA rule 110 step from binary to integer
FromDigits[#,2]&/@CellularAutomaton[110,{{1},0},100]
Out[]=
{1,3,7,13,31,49,115,215,509,775,1805,3359,7985,12659,29655,54909,130759,197581,460383,855793,2038675,3227319,7562237,14149127,33304077,50625055,118279729,220060275,523730647,830325757,1942439431,3595423245,8571017759,12951092785,30166680179,56073062103,133588389885,211506632711,495595632653,927282980895,2182630996017,3317787986035,7751589107927,14421896018429,34323198077703,54416196370189,127299712123167,235629660144433,561710225360755,848762827640279,1977003578040189,3674804184363463,8754848687027021,13861298716530655,32479355484535921,60770417340630227,143040904663518711,217434554115514141,508008145375195447,945153379850261373,2249405108907685831,3566219845213912141,8342713933848429791,15442225407640063473,36812241330160754451,55624520673653289271,129564906493785609085,240831967026411943879,573757763553089125453,908414072686300611807,2128567041033967652337,3982650070836453498643,9374328728027309273399,14249790938515313660797,33292821815303618836423,61941571901883287764045,147417013217356970116319,233715783775887200079345,546748100368571293523731,1012021684315080846537015,2412527047813364619252605,3645408586868459401623495,8491165711976891861630029,15783163791042765655082207,37601788792215759687814641,59533824667570381304471315,139497769601204248233357623,261006955042341238400283517,614356007519983699358881735,933874298946519280208231501,2181878370487689242068640991,4059402856161728760288652785,9661121378212845929008496403,15316797605536961238055567671,35831683505755328373916812157,66323853103274785902051411911,158107372605499565259962174541,238905497149018242161676672223,556477036100104514689222899185,1034365422209781946375836114707,2464270830286606414527613612343}
It quickly produce big integers, lets visualize it:
ListLinePlot[4,ColorFunctionHue]
Out[]=
For a better visualization, we can LOG the integers data:
ListLinePlot[Log[%],ColorFunctionHue]
Out[]=
Or we can view with ListLogPlot:
?ListLogPlot
Out[]=
Symbol
ListLogPlot[{
y
1
,
y
2
,…}] makes a log plot of the
y
i
​, assumed to correspond to x coordinates 1, 2, ….​ListLogPlot[{{
x
1
,
y
1
},{
x
2
,
y
2
},…}] makes a log plot of the specified list of x and y values.​ListLogPlot[{
data
1
,
data
2
,…}] plots data from all the
data
i
.​ListLogPlot[{…,w[
data
i
,…],…}] plots
data
i
with features defined by the symbolic wrapper w.
ListLogPlot[%,ColorFunctionHue]
Out[]=
From the elementary cellular automata rule 110, starting with 1 in binary as initial condition, we can process each step, and convert the binary output to integer and keep/highlight just the prime numbers. It creates a unique sequence of integers. This CA rule is able to do universal computation.
If[PrimeQ[#],Style[#,Red],#]&/@(FromDigits[#,2]&/@CellularAutomaton[110,{{1},0},100])
Out[]=
{1,3,7,13,31,49,115,215,509,775,1805,3359,7985,12659,29655,54909,130759,197581,460383,855793,2038675,3227319,7562237,14149127,33304077,50625055,118279729,220060275,523730647,830325757,1942439431,3595423245,8571017759,12951092785,30166680179,56073062103,133588389885,211506632711,495595632653,927282980895,2182630996017,3317787986035,7751589107927,14421896018429,34323198077703,54416196370189,127299712123167,235629660144433,561710225360755,848762827640279,1977003578040189,3674804184363463,8754848687027021,13861298716530655,32479355484535921,60770417340630227,143040904663518711,217434554115514141,508008145375195447,945153379850261373,2249405108907685831,3566219845213912141,8342713933848429791,15442225407640063473,36812241330160754451,55624520673653289271,129564906493785609085,240831967026411943879,573757763553089125453,908414072686300611807,2128567041033967652337,3982650070836453498643,9374328728027309273399,14249790938515313660797,33292821815303618836423,61941571901883287764045,147417013217356970116319,233715783775887200079345,546748100368571293523731,1012021684315080846537015,2412527047813364619252605,3645408586868459401623495,8491165711976891861630029,15783163791042765655082207,37601788792215759687814641,59533824667570381304471315,139497769601204248233357623,261006955042341238400283517,614356007519983699358881735,933874298946519280208231501,2181878370487689242068640991,4059402856161728760288652785,9661121378212845929008496403,15316797605536961238055567671,35831683505755328373916812157,66323853103274785902051411911,158107372605499565259962174541,238905497149018242161676672223,556477036100104514689222899185,1034365422209781946375836114707,2464270830286606414527613612343}
Those are the primes found at the 100 numbers (rule 110 steps)
Those are the primes found at the 1,000 numbers (rule 110 steps)
Lets see how the integer size grows:
Wolfram Language can quickly check if a big integer is prime:
Lets breakdown the digits to visualize it...
Now lest see for just the last digits of rule 110 primes....
It is curious that all the first integers from rule 110 first 1,000 steps ends with an odd number:
Lets check for the first 10,000 steps of rule 110:
And so, the primes in the first 10,000 steps of CA rule 110:
Breakdown and visualize the digits...
Visualize the digits of each CA rule 110 individual step in a graph:
Lets visualize those digits in a 2D graphic, perhaps it is a good inspiration for an NTF! :-)
To learn more:
​
https://www.wolframscience.com/nks/p690--the-significance-of-universality-in-rule-110/
https://mathworld.wolfram.com/ElementaryCellularAutomaton.html
https://mathworld.wolfram.com/Rule110.html
https://mathworld.wolfram.com/PrimeNumber.html