to your HTML Add class="sortable" to any table you'd like to make sortable Click on the headers to sort Thanks to many, many people for contributions and suggestions. Licenced as X11: http://www.kryogenix.org/code/browser/licence.html This basically means: do what you want with it. */ var stIsIE = /*@cc_on!@*/false; sorttable = { init: function() { // quit if this function has already been called if (arguments.callee.done) return; // flag this function so we don't do the same thing twice arguments.callee.done = true; // kill the timer if (_timer) clearInterval(_timer); if (!document.createElement || !document.getElementsByTagName) return; sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/; forEach(document.getElementsByTagName('table'), function(table) { if (table.className.search(/\bsortable\b/) != -1) { sorttable.makeSortable(table); } }); }, makeSortable: function(table) { if (table.getElementsByTagName('thead').length == 0) { // table doesn't have a tHead. Since it should have, create one and // put the first table row in it. the = document.createElement('thead'); the.appendChild(table.rows[0]); table.insertBefore(the,table.firstChild); } // Safari doesn't support table.tHead, sigh if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0]; if (table.tHead.rows.length != 1) return; // can't cope with two header rows // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as // "total" rows, for example). This is B&R, since what you're supposed // to do is put them in a tfoot. So, if there are sortbottom rows, // for backwards compatibility, move them to tfoot (creating it if needed). sortbottomrows = []; for (var i=0; i
If you ever want to go down a very deep rabbit hole, and you're mathematically minded, searching out patterns in prime numbers is a great place to begin.
In fact, if you just want to start somewhere simple, try this. Set up a table with six columns. Starting in the first row of the table, with the first prime number, 2, number all the boxes of the table from left to right. Then, move down to the next row of the table and continue the numbering process. Add as many rows as you like.
When you've made a decent-sized table, stop adding rows and go back to visually distinguish the prime numbers among all the numbers you wrote. You should pretty quickly find your first patterns.
We did that exercise, using just the numbers from 2 to 211. Here's the table we generated, along with some of the patterns we were able to identify:
Except for the first row, which has four prime numbers (2, 3, 5, and 7), each subsequent row contains no more than two prime numbers in it. Each of those prime numbers appear in just two columns that we've identifed as Set D, which starts with 5 in the first row, and Set F, which starts with 7.
By setting up the list of numbers this way, we've effectively sieved the full set of integers to exclude multiples of 2 (Set A, Set C, and Set E) and multiples of 3 (Set B and Set E). We find that we can define all potential prime numbers larger than three as a multiple of six (Set E), where we either subtract one to obtain a potentially prime value in Set D or add one to obtain a potentially prime value in Set F.
We can then look at how frequently primes appear in these columns. When both the Set D and Set F values in the same row are prime, these are what mathematicians call twin primes. Whenever Set F in one row is prime and is followed by another prime in Set D in the next row, that's what mathematicians call couple primes. And whenever prime numbers appear next to each other in the same column, either in Set D or in Set F, mathematicians call "sexy" primes.
That last kind of prime is actually a bad mathematical pun. You'll notice that the minimum difference between any two sexy primes is six. In Greek, the word for six is εχι. If you're the kind of mathematician who slurs their words after consuming certain beverages, you might say that the Greek word for six issexi....
Unfortunately, not every value in the Set D and Set F columns are prime numbers. Some are composite numbers, which is to say they are found by multiplying prime numbers together, and even they have a pattern. If you multiply two primes from Set D together, you'll find their product in the Set F column. That's also true if you multiply two primes from Set F together.
But if you multiply a prime from Set D with a prime from Set F, you'll only find the resulting composite product in the Set D column.
These are far from the only patterns going on with the distribution of prime numbers. Back in 1963, Stanislaw Ulam found that when he wrote numbers out in a spiral order on a square grid, the prime numbers would appear in diagonal patterns.
The Coding Train's Daniel Shiffman explains how to generate Ulam's Spiral and develops code to generate it in the following 24 minute video:
The Ulam (or Prime) Spiral forms when numbers are written in order in a spiral pattern on square grid paper, but since we already know that the distribution of primes is linked to multiples of six, what would we find if we repeated that exercise using a hexagonal grid?
The following image illustrates some new patterns that emerge in a hexagonal spiral. Just for fun, we've indicated the prime numbers with boldface font and have colored the hexagons that correspond to Set D and Set F in our original table and have used red lines to connect the twin primes:
Using a hexagonal grid like this, additional relationships can be identified to map out where prime numbers may occur. In practice, that means we can break the Set D and Set F values into subsets that can be independently explored. In 2011, Dmitri Tishchenko mapped 90,000 numbers onto a hexagon grid like this, which gives some tantalizing hints at the underlying structure of primes. He had left the task of visualizing the Set D (6n-1) and Set F (6n+1) on the grid for a future project, which is what inspired us to create our hexgrid chart.
Then again, if you really want to things to the next level, you could write out the numbers using polar coordinates on an Archimedian spiral. The patterns that arise when you do that leads to a whole different story for another long holiday weekend.
José William Porras Ferreira. The Pattern of Prime Numbers. Applied Mathematics, Vol. 8, No. 2. DOI: 10.4236/am.2017.82015. [PDF Document]. February 2017.
Image credit: Primes vs Composites by David Eppstein via Wikimedia Commons. Creative Commons CC0 1.0 Universal (CC0 1.0) Public Domain Dedication.
Notes: We've released the Basic Patterns of Primes image, which is freely available via Wikimedia Commons under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.
Welcome to the blogosphere's toolchest! Here, unlike other blogs dedicated to analyzing current events, we create easy-to-use, simple tools to do the math related to them so you can get in on the action too! If you would like to learn more about these tools, or if you would like to contribute ideas to develop for this blog, please e-mail us at:
ironman at politicalcalculations
Thanks in advance!
Closing values for previous trading day.
This site is primarily powered by:
The tools on this site are built using JavaScript. If you would like to learn more, one of the best free resources on the web is available at W3Schools.com.