What would happen if you made a chart based on the following patterns (wherein everything repeats except for the “Initial Skip” which is a one-time event):


Initial Skip Red/Black Skip Red/Black Skip
0 Black 2 Red 1
0 Red 4 Black 1
1 Black 6 Red 3
1 Red 8 Black 3
2 Black 10 Red 5
2 Red 12 Black 5

Etc.

You would get a graphic like this one:

You might be thinking, “So?” Well, one of the things that I enjoy about mathematics is that it is easy to come up with several different paths to the same destination. In fact, I remember my geometry teacher in high school say the following about someone’s proof: “Your method gets us to the solution, but it’s like driving from here [a small town near Pueblo , Colorado ] to Colorado Springs via Fairbanks , Alaska . You get there, but it’s the long way.”

Mathematicians typically seek the most “elegant” solution, where elegance is defined as the simplest solution. You can have bulky proofs that get you where you need to go, but a sleek, elegant proof is preferable. However, in my opinion while they may be preferable in the ethereal sense, the various perspectives on mathematical problems actually help us to more fully understand the concepts involved. And indeed some mathematical truths may be easier to see in one perspective than in another perspective.
That is one of the reasons that I’ve been looking at the “Factor Field” sheet I’ve made in Excel and drawing conclusions from it. Now I’ll be the first to admit that I’m never very good at calculations in mathematics, but I am a very visual mathematician (this is why I’ve always liked geometry the most out of all kinds of math). Some who are really good at calculations have already proven such things as: All prime numbers exist in the format of 6n +/- 1. They proved this by showing that any other number than 6n +/- 1 must be divisible by 2 and or 3, and therefore cannot be prime. I came to this same conclusion independently by looking at the Factor Field and seeing the 6-spike there and wondering what it would look like if I converted it to base 6 numbers.

I think the visual representations are therefore a very powerful tool. Again, I’m not the greatest at calculations and therefore if I had to limit myself to calculations I wouldn’t get very far. But because in our day and age computers make it easy to come up with visual representations, someone like me can look at these patterns and then formulate equations just as complicated as those who are good at calculations come up with. That’s what I did with the above graphic. So how did I come up with it?
Well, remember this graphic?

I started by looking at the 5 column. Then I counted the 6-spikes and put on a graph whether the number was higher or lower than the 6-spike. So for the first one, the 5 line starts with the number higher. It got a black cell. After that, the 5 column skips 2 6-spikes before touching lower on the 6-spike. Therefore, I skipped 2 and then put a red cell. After that, it skips 1 6-spike (where it’s actually on the 6-spike) and repeats the sequence.

I did the same with 7, 11, 13, etc. until I got the above chart. Here’s it reproduced with the vertical and horizontal axis labeled appropriately as well as a “total” line at the bottom:

Now here’s how to understand what is there. Look at the column headers. They are all multiples of 6. Those who remember that P numbers (as I’ve defined them) are in the format of 6n +/- 1 should already know where this one is heading. A cell will be black if it is in the 6n – 1 format; red if it’s in the 6n + 1 format.

The total line is created in this way. Excluding the first red and black (the cells that appear after the initial skip, but not after any of the repetitions), if there is a red cell (or more than one) and no black cells in the column, the cell for that column on the total line gets marked red. If there is a black cell (or more than one) and no red cells, it gets marked black. If there are both red and black cells, it gets marked blue. If there are no red or black cells, it remains gray.

Now if there is a red cell on the total line, that means that the 6n + 1 number is not prime. If it’s black, then 6n – 1 is not prime. If it’s blue, then neither 6n + 1 nor 6n – 1 are prime. If it’s gray, then both 6n + 1 and 6n – 1 are prime.

Pick one of the numbers on the total line (let’s use 84). The cell on 84 is red. Red refers to a 6n + 1 number. Therefore, we know that 84 + 1 is not prime. And sure enough, 85 is not prime. Furthermore, you can look in the column above the total line and see the factors of 85 listed out in all the red cells: 17 & 5.

Since 84 is red (not blue) then we know that the 6n – 1 of 84 (83) is prime.

Let’s look at another number: 120. 120 is blue, so we know that neither 119 nor 121 is prime. And sure enough, we can find the factors of each in the above graph. 119 has factors of 17 and 7 (119 is a 6n – 1 number, so look for the corresponding black cells) and 121 has 11 as a factor (121 is a 6n + 1 number, so look for the corresponding red cell).

Now here’s the thing about this graph. I made it without doing a single factor calculation! Instead, I looked at the pattern, and the pattern shows us this (where a “-“ refers to a 6n – 1 number and a “+” refers to a 6n + 1 number, represented by black and red respectively):

5:   0 - 2  + 1
7:   0 + 4  - 1
11:  1 - 6  + 3
13:  1 + 8  - 3
17:  2 - 10 + 5
19:  2 + 12 - 5
23:  3 - 14 + 7
25:  3 + 16 - 7

And furthermore, from looking at this pattern, I’ve been able to deduce a general rule whereby you can figure out what the repetition of any specific line (L) on the graph would look like. To find it, you do the following:

1. Calculate if number N is a 5 or 1 number (i.e. if it is in the 6n + 1 or 6n – 1 format).
A. Convert to base-6, see if last digit is 5 or 1 or…
B. Find the remainder of N/6 (you can use N mod 6 on a calculator). It must be either 5 or 1.

E.g. 35. 35/6 = 5 r 5. It is a 5 number.
E.g. 49. 49/6 = 8 r 1. It is a 1 number.

2. Calculate Initial skip for starting skip variable (S).
A. If 5 number, the integer (non remainder) portion of N/6 is the Initial Skip: S = N/6
B. If 1 number, the integer (non remainder) portion of N/6 less 1 is the Initial Skip. S = (N/6) - 1

E.g. 35. 35/6 = 5 r 5. 5 is Initial Skip.
E.g. 49. 49/6 = 8 r 1. 8 - 1 = 7. 7 is Initial Skip.

3. If N is a 5 number (Black), the pattern is: S + Black + (4S + 2) + Red + (2S + 1).

E.g. N = 35. S is the integer portion of 35/6 = 5. Substitute into the equation and you get 5 + Black + 22 + Red + 11.

4. If N is a 1 number (Red), the pattern is: S + Red + (4S + 4) + Black + (2S + 1).

E.G. N = 37. S is the integer portion of 37/6 less 1 (i.e. 6 – 1 = 5). Substitute into the equation and you get: 5 + Red + 24 + Black + 11.

The two patterns are:

S + Black + (4S + 2) + Red + (2S + 1)
S + Red + (4S + 4) + Black + (2S + 1)

In reality, the initial S is not part of the pattern, it just slides the pattern over. If we put the portion that repeats into brackets [], you get:

S + [Black + (4S + 2) + Red + (2S + 1)]
S + [Red + (4S + 4) + Black + (2S + 1)]

Repeat what’s in the brackets for however many times you need.

Now as you can see from the graph, you don’t really need to check many of the values to determine if a specific number is prime or not. You only need to find the column that the number appears in after sliding over from the left and make sure that there are no corresponding marks in the column above it.

So let’s start with one that we can empirically verify on the chart. The number 35. 35 is a “Black” number because it is a 5 number (as shown above). The Initial Skip value (S) is 5. This means that there are 5 skips before the number appears, so the number will appear in the 6th column. So you can always find the column (C) by finding S + 1. In our test, C = 6.

Now since 35 is a “Black” number (i.e., a 6n – 1 class number) we only have to worry if there are any other “Black” numbers in the same column. Red numbers do not matter because they will not match up with the Black numbers. However, there will be two functions that we have to use in order to test a specific value. The first function is the one that calculates where on the grid a Black number places a Black mark. The second function calculates where on the grid a Red number places a Black mark (after all, they alternate back and forth as they go across).

So when testing where a Black number puts a Black mark on the grid, we use this function:

F(S, x) = S + (1 + x) + x[(4S + 2) + 1 + (2S + 1)].

To us this function, we’ll need a nested loop (a loop within a loop). First start with S and x both equaling 0. We can set up the test in the following computer pseudo-code:

For S = 0 to C
X = 1
            While TestValue < C
                        TestValue = F(S, x)
                        x = x + 1
            End While Loop
If TestValue = C, then the number is not prime and you should break loop.  Otherwise…
Next S

By the way, if you’re wondering why we start with x = 1 instead of x = 0, it’s because whenever x = 0 then the function value will always equal the S value + 1. And therefore, F(S, x =0) can be ignored because it will always be less than the C value except when it equals the C value (which means you’re testing the number against itself, which is pointless).

Let’s go ahead and test it with our variables as x = 0 and S = 0 to show this. Remember that when S = 0 that means the initial skip value is 0. Since we’re looking at Black numbers, we know that this corresponds to the first row on the chart, so we can check that to verify if the function works correctly. We are therefore going to re-create the first row, but we only need to do so up until we get to column 6 since the number N that we are testing is 35.

F(S, x) = S + (1 + x) + x[(4S + 2) + 1 + (2S + 1)].
F(0,0) = 0 + (1 + 0) + 0{[4(0) + 2] + 1 + [2(0) + 1])}
F(0,0) = 1

When x = 0, therefore, we see that F(S, x = 0) will equal S + 1. And this is accurate: The first Black mark does indeed show up in the first column. (You can multiply the F(S,x) answer by 6 to get the correct header if you want, but the labels aren’t actually relevant here.)

Anyway, let’s continue with x = 1:

F(S, x) = S + (1 + x) + x[(4S + 2) + 1 + (2S + 1)].
F(0,1) = 0 + (1 + 1) + 1{[4(0) + 2] + 1 +[2(0) + 1]}
F(0,1) = 2 + (2 + 1 + 1)
F(0,1) = 6

At this point F(0,1) is not less than 6 because it in fact equals 6. Therefore, the loop breaks out. The program then tests if the final value equals the value being searched for. It does. Therefore, 35 is not prime and the program terminates.

Just to show it works, let’s see what happens if we pick a prime “Black” number, such as 29. First, we calculate the S number. S = the integer portion of 29/6 = 4.

C = S + 1, so C = 5.

Now we start through the function, once against starting with S =0 and x = 1. Obviously, the first result of F(0,1) will yield the exact same results as what is shown above. Since the C value is now 5, however, we have F(0,1) = 6 which is greater than 5 but it is not equal to 5. This means we increase the S value to 1 and reset the x to 1 and repeat the loop:

F(S, x) = S + (1 + x) + x[(4S + 2) + 1 + (2S + 1)].
F(1,1) = 1 + (1 + 1) + 1[(4(1) + 2) + 1 + (2(1) + 1)]
F(1,1) = 3 + [6 + 1 + 3]
F(1,1) = 13.

If you check the chart, you will see that the second black mark for the 11 row is indeed located at column 13.

Now we can see that {F(1,1) = 13} greater than {C =5}. Therefore, we increase the S to 2, and reset the x to 1.

F(S, x) = S + (1 + x) + x[(4S + 2) + 1 + (2S + 1)].
F(2,1) = 2 + (1 + 1) + 1[(4(2) + 2) + 1 + (2(2) + 1)]
F(2,1) = 4 + (10 + 1 + 5)
F(2,1) = 20.

{F(2,1) = 20} greater than {C = 5} so increase S to 3 and reset x to 1.

F(S, x) = S + (1 + x) + x[(4S + 2) + 1 + (2S + 1)].
F(3,1) = 3 + (1 + 1) + 1[(4(3) + 2) + 1 + (2(3) + 1)].
F(3,1) = 5 + (14 + 1 + 7)]
F(3,1) = 27.

Now I’m sure you can see the pattern that is resulting from this function. Increasing the S value will always yield a larger answer (in fact it’s the previous answer + 7). Therefore, if at any point when x = 1 the function is greater than the C value, we know that there are no more factors that we need to test. Note that this wouldn’t prove that the number is prime; it merely proves that no other Black numbers are factors for it. We still have to do a function for where the Black marks appear on the Red numbers, and we get that in the following function:

F(S, x) = S + 1 + x(4s + 4) + 1 + (x – 1)(2S + 1)

Once again, we can test it with figures we know from the chart. For instance, when S = 0 and x = 1:

F(0,1) = 0 + 1 + 1(0 + 4) + 1 + (0)(0 + 1)
F(0,1) = 6

If you look at the chart, the first “Red” number is on the 7 line, and the first black mark is indeed at column 6. Testing S = 1 and x = 1, we see:

F(1,1) = 1 + 1 + 1(4(1) + 4) + 1 + (0)(2(1) + 1)
F(1,1) = 1 + 1 + 8 + 1
F(1,1) = 11.

The first black mark on the second Red number (13) is indeed at column 11.

So that means that we can test any “Black” number (i.e. 6n – 1) to see if it’s prime by running it through these two functions:

F(S, x) = S + (1 + x) + x[(4S + 2) + 1 + (2S + 1)]
F(S, x) = S + 1 + x(4s + 4) + 1 + (x – 1)(2S + 1)

Testing for “Red” numbers (i.e. 6n + 1) is similar. In those cases, the functions look like this:

F(S, x) = S + (1 + x) + x[(4S + 4) + 1 + (2S + 1)]
F(S, x) = S + 1 + x(4S + 2) + 1 + (x-1)(2S + 1)

You can test them to see they match up to the chart if you want. I will simply conclude this by pointing out that using math no more complex than simple Algebra, you can test whether a number is prime or not…all without doing massive amounts of division! The only division you have to do is to divide your test number by six to get the starting integer (so you can get the S value) and the remainder (so you can determine if you’re looking for a 6n + 1 or 6n – 1 number).