Wolfram Demonstrations: Source code
Prime-Generating Cellular Automaton