Prime map generator

Home | Help


Range start

Range end

Wait mode

Map style

Mark prime

Prime k-tuples

Special primes


Grid width
Sieve interval (ms)

Background colour

Composite colour

Prime colour

Mark prime colour

Temporary composite colour



Help Close
Help | Interface | Changelog | Browser comparison
This section just answers some questions you may have. Go to the Interface section if you have questions that are more about how the controls and interface work exactly. Even deeper questions can be answered by thoroughly looking at the code.

Q: What is this, and what does it do?
A: This is the Prime map generator ([there should be a version number here]). It's made to draw 'maps' in different shapes and sizes of prime numbers. It uses given values to create a huge table of all selected prime numbers, and gives prime numbers and composites colours. The result is some sort of 'map' that displays where these prime numbers are located relative to each other.

Q: What algorithm is used to find these primes?
A: The Sieve of Atkin. I actually accidentally reinvented it when I tried to optimalise the old sieve of Erathosthenes.

Q: Sieve of Atkin? There's far quicker methods than that!
A: Not really a question, but OK. I know there's faster methods than the sieve of Atkin, but that's not the aim of this generator. This is just a simple generator that shows a few nice map. Not only that, but a simple webpage with Javascript can't even reach the numbers where those faster methods have a significant faster calculating time. And lastly, those faster methods are not 100% reliable. Sure, 99%, but 99% < 100%.

Q: What are prime k-tuples?
A: A prime k-tuple is a set of values representing a repeatable pattern of differences between primes. For example, a twin prime is a set of primes where the difference is exactly two. You may also enter your own constellation.

Q: What are defined as primes and what as composites?
A: 0 and 1 are neither. Every integer that has only itself as a prime factor is a prime. The rest is a composite.

Q: I'm using Firefox and--
A: Did you not read the message that popped up when you visited this website with Firefox? Firefox' JS engine is horrible and slow. Firefox-only bugs will not be fixed. I fixed one Firefox bug once, but that was before I found out about how horrible SpiderMonkey is. Try going to the Browser comparison section of the help menu to see what I mean.

Q: Is there a browser that I should use for this?
A: Of course, the choice is up to you. However, I'd really recommend using Google Chrome or Opera, though Chrome is just slightly better. They both use the V8 JE engine. After that come Internet Explorer and Safari, but while those two would be number three and four, there is still a huge performance gap between them and the numbers one and two. Number five is Firefox. I haven't really took the time to test other browsers.

Q: How accurate are the timers?/Why does it give either 16ms or 0ms, not in between?
A: The timer is started right after having initialised everything, and it's the first thing that is stopped once the calculations are done. The timer should be accurate up to about 16ms, depending on your browser. Your browser executes loops at a maximum speed of about 16ms each cycle, some browsers quicker than others.

Q: Is there a changelog?
A: While the changelog can be accessed by clicking "Changelog" directly underneath the big "Help" above here, you may also access it directly here.

Q: What are my legal limitations?
A: The legal stuff can be found in the heading section of the code.
The toolbar
The toolbar
The toolbar is where everything is controlled and all information can be viewed. It's where pretty much everything is done.
At the top is the title of this program, "Prime map generator". Underneath that are buttons to return to this website's main page, and one to open the very help window you're now in.
After that are three buttons, used to navigate through the three types of settings: Standard, Advanced and Graphics. Pressing one such button will hide the current tab, and open the selected tab.

Standard settings
Standard settings
Range start This value is the very first number that will be displayed in the prime map. All numbers before that will not be shown. Only numbers of the integer type are allowed, provided they're not 0.
Range end This value is the last number to be shown in the prime map. Much like the range start, this number must be an integer higher than 0, but on top of that comes that this value must also be higher than the range start.
Wait mode This option knows three options: Normal, Interval and Buttons.

The normal options will simply generate the prime map as fast as possible, the best option if you care only about the result.
The interval option will put a delay in between of each step, which is handy if you want to slow the process of generating down to view it a little more precisely. The length of the interval can be changed under the Advanced settings.
Lastly, the buttons option will add two buttons in the Progress bar (which appears just underneath the settings): '+' and 'F'. The idea of this option is that the generator will not move on to the next step until you have clicked the button. This allows for very detailed observations into the generating process. Clicking + will go to the next step, while clicking F (which stands for 'Finish') will stop the waiting mode and continue the current generation like it were a normal generation.

Advanced settings
Advanced settings
Map style The map style has three options: Grid, Ulam spiral and Sacks spiral. This options must be selected before generating. The grid is the most basic one, simply displaying all primes in a grid.
The Ulam spiral is a blocky spiral where the first prime number is placed in the middle, the second one to its right, then two numbers on top etc. Like this, a spiral will be formed around this point. This style is very interesting because several big lines can be seen, of which can be proven that indeed more primes lie on that line than on any other line. Each rotation has the value of two square numbers.
The Sacks spiral is an Archimedean spiral, where the number 0 is placed in the middle, and then every rotation (counterclockwise) contains exactly one square number of numbers, each equally spaced. Looking like a Death Star, this shape also has its own peculiarities, having certain curves with more primes on it than any other curve.
Mark prime Previously called "prime k-tuples", ever since the addition of the special primes type, the mark prime settings allows you to mark a certain type of primes in the map. You can choose to mark none, to display a type of prime k-tuples or to mark a special type of prime.
A prime k-tuple is a set of values representing a repeatable pattern in the differences between primes. For example, the (0, 2) is a twin prime, meaning that all primes that have another prime at its value plus two will be marked (and its value plus two as well). Try looking a few of these constellations up.
You may also choose to write your own prime k-tuple by entering this in the text field. The syntax used is "a1,b1,c1,...;a2,b2,c2,...;...". The different possible sets are seperated by a semi-colon, and inside those sets each relative number is seperated by a comma.
You may also choose to mark a special type of prime. For example a Gaussian prime. These options are right underneath the prime k-tuples.
Special Toggle auto-zoom toggles whether the program should auto-zoom after generating the map. This option makes sure the whole width of the map fits on the page.
Show new composites per step gives the numbers that have been filtered that step another colour, which show what numbers disappear each step. This is very handy for researching patterns.
Grid auto width (and included with that is Grid width) allow you to change the width from the Grid map style. The default setting (which is Grid auto width enabled) makes sure the grid fits on the page based on the browser width, choosing from widths 100, 50, 25, 10 and 1 (width in columns of primes, that is). Disabling this enables you to enter your own width.
Sieve interval changes the interval between each step from sieving. This text input can only be accessed when Wait mode "Interval" has been selected on the Standard settings tab. The amount of time is to be entered in milliseconds.

Graphics settings
Graphics settings
Collapse cell borders This option will remove the spacing between the block of the prime map. This only works for the Grid and the Ulam spiral. This is a handy tool to make the grid more compact and to find shapes and patterns.
Colours These options allow you to change the colours to your liking, making the interface clearer or more to your liking in another way. The names of the colours should speak for themselves.
Note: Some browsers (Google Chrome) open an interface with a colour selector. Sometimes, selecting a colour here will not change the colours immediately. Select another colour, and go back to the colour you want.
Reset colours By clicking this button all colours are reverted to their original, default state.

Zoom options
Zoom options
Zooming allows you to change the size of the map. With the grid and Ulam spiral types of map, zooming in and out will change the size of each block and their distance. The Sacks spiral type of map will do both that and completely redraw the map to make sure the spiral stays intact. Because of this zooming in and out on a Sacks spiral will take much more time.
In between of the + and - buttons the current zoom level will be displayed. While there is no maximum value, the minimum value for the grid and Ulam spiral are 1 (as this means each block is one pixel in both dimensions, smaller is not possible), and -8 for the Sacks spiral. The Sacks spiral will no longer shrink the blocks itself under a value of 1, and only shrink the size of the spiral itself.

Map info
Map info
Progress This part shows the current generating progress. Before any generating it shows "Nothing", and once it's done it says "Done!". A progress bar will fill up in between of these two points, giving an approximation of how far the calculating is. Note that, because of the intensity, no progress will be shown during the drawing of the initial map. Only once the program starts calculating will there be any updates here.
Data This is where any general data about the generated data itself will be posted: the total amount of numbers shown in the map, the amount of primes and those numbers divided (times 100), being the percentage of primes in the whole map.
Number data Lastly, the number data section is where any information on the currently selected number will be dumped. One can collect this information by hovering over a square in the map. By clicking a number, the hovering selection will be disabled. It can be reenabled by selecting the currently selected number.
The information displayed here are what number is currently selected, whether it's a prime or a composite, and its prime factors.

If no changelog is here, something went wrong
Google Chrome Opera Internet Explorer Firefox Safari
Browser version 31.0.1650.63 m 18.0.1284.63 11.0.9600.16428 25.0.1 5.1.7
JS engine V8 V8 Chakra SpiderMonkey JavaScriptCore
1000 Total 62 ms 94 ms 126 ms 208 ms 93 ms
Drawing 15 ms 31 ms 59 ms 19 ms 17 ms
Sieve 47 ms 63 ms 67 ms 189 ms 76 ms
2500 Total 265 ms 296 ms 585 ms 919 ms 410 ms
Drawing 31 ms 46 ms 62 ms 20 ms 47 ms
Sieve 234 ms 250 ms 523 ms 899 ms 363 ms
5000 Total 639 ms 702 ms 1576 ms 3255 ms 1278 ms
Drawing 31 ms 46 ms 98 ms 30 ms 44 ms
Sieve 608 ms 656 ms 1478 ms 3225 ms 1234 ms
10000 Total ms 1809 ms 1981 ms 4659 ms 12594 ms 4570 ms
Drawing 62 ms 94 ms 166 ms 43 ms 80 ms
Sieve 1747 ms 1887 ms 4493 ms 12551 ms 4490 ms
25000 Total 8596 ms 8970 ms 21190 ms 82549* ms 27377 ms
Drawing 156 ms 172 ms 409 ms 110 ms 181 ms
Sieve 8440 ms 8798 ms 20781 ms 82439 ms 27196 ms

* Firefox crashed twice while performing these calculations

Prime map generator [version], written by Felix Dekker.