Patterns in Prime numbers, and the null hypothesis I've read about many attempts to find patterns in prime numbers.  First, is there a mathematical way to prove there is not a pattern to prime numbers?  Since there are ways to check if a number is prime or not, can these methods be combined into some large function that produces prime numbers?  And in case it isn't obvious, no, I never got passed pre-Cal.
I like Dirichlet's Theorem, which states that for relatively prime $a,d \in \mathbb{Z}^+$, there are infinitely many primes in the progression $\{a + nd \mid n \in \mathbb{Z^+}\}$.  Further, the proportion of primes in any relatively prime residue class of $d$ is about $1/\phi(d)$, where $\phi$ is the Euler phi function.

In essence, the primes can be seen as somewhat evenly distributed.  You can see more below.

http://en.wikipedia.org/wiki/Dirichlet%27s_theorem_on_arithmetic_progressions
(Amateur response. BS in MIS, MS in Curriculum &amp; Instruction. Retired College Computer Instructor / IT Support. No higher mathematics classes. Non-standard expression of formulas and language. If this answer is of any value, I would consider giving a presentation about it.)

Prime Numbers are not random. Prime numbers are a completely patterned phenomenon. Prime numbers are a system of mechanistic chaos. Prime Numbers can be thought of as a collection of moiré-like interference patterns. Prime Numbers are the result of overlaying an infinite quantity of infinitely repeating finite patterns.  

For this answer: Prime Numbers are Base$_{10}$ positive integers that have two and only two unequal positive integer factors.

$P_i$ is a specific Prime Number where $_i$ is a positive integer.
For example: $P_1$ = the first Prime Number, $2$. $P_2 = 3$, $P_3 = 5$, $P_4  = 7$, …  

$P_i^2$ = the square of a specific Prime Number.
For example: $P_3^2$ = $5^2$ = $25$.  

$P_i!$ or Prime Factorial is the multiplication of all Prime Numbers from $P_1$ through $P_i$.
For example: $P_4!$ = $P_1 * P_2 * P_3 * P_4$ = $2 * 3 * 5 * 7$ = $210$  

$I$ is any positive integer  

Because a Sieve is usually constructed as an array of rows and columns and because the only purpose of the sieve is to find prime numbers, patterns are very difficult, if not impossible, to discern. Instead of an array, construct the Sieve using a linear format.  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 … 

The integer one ($1$) will be eliminated because it does not have two unequal positive integer factors.  

_ 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 … 

The next available integer is two ($2$) and by direct examination is found to be Prime - it has two unequal positive integer factors: $1, 2$.  

All multiples of $2$ or $P_1$ that are larger than $2$ will be eliminated.  

_ 2 3 _ 5 _ 7 _ 9 _ 11 _ 13 _ 15 _ 17 _ 19 _ 21 _ 23 _ 25 _ 27 _ 29 _ 31 _ 33 … 

To state the obvious, all Prime Numbers larger than $2$ will be odd. Also, it is important to observe that the first integer to be eliminated is $4$ or $2^2$ or $P_1^2$.  

The elimination of multiples of $2$ creates the first pattern. Starting at $P_1$!$ + 1$ or $5$, is an infinitely repeating finite pattern with a length of $2$ or $P_1$!. Within each $P_1$! pattern, one element or $50$% of the pattern has been eliminated. Essentially, for the set of positive integers, $50$% of that set has been eliminated. The repeating pattern for $P_1$! is:  

_ $I$  

The next available integer is $3$ because it was skipped when the multiples of $2$ were eliminated. By direct examination - and because it was skipped - $3$ is a Prime Number. All multiples of $3$ or $P_2$ that are larger than $3$ and have not already been eliminated will be eliminated. The eliminated integers will be called Strikeouts.  

_ 2 3 _ 5 _ 7 _ _ _ 11 _ 13 _ _ _ 17 _ 19 _ _ _ 23 _ 25 _ _ _ 29 _ 31 _ _ _ 35 _ 37 _ _ _ 41 _ 43 … 

The first Strikeout is $9$ or $3^2$ or $P_2^2$. The elimination of multiples of $3$ creates the second pattern and it overlays the first pattern. Starting at $P_2$!$ + 1$ or $10$, is an infinitely repeating finite pattern with a length of $6$ or $2 * 3$ or $P_1 * P_2$ or $P_2$!. Within each $P_2$! pattern, one additional element or $16.6$% of the pattern has been eliminated. When combined with the 50% elimination of the previous pattern, then for the set of positive integers, $66.6$% of that set has been eliminated. The $P_2$! pattern is:  

$I$ _ _ _ $I$ _  

With this pattern, an infinite set of Prime Number groupings - twins, quads, etc. - has been created.  

At this point, generalizations about Prime Numbers can be made.  

For each Prime Number used to eliminate integers, the next Prime Number will always be known. In fact, the next several Prime Numbers will be known. As it will continue to be shown, Prime Numbers arise from a self-generating iterative process.  

Every Prime Number has both a pattern and a Range of Influence (RoI). The RoI extends from the square of the Prime Number to one less than the square of the next Prime Number. Within the RoI, any remaining integers are Prime. For 2, its RoI extends from 4 to 8 - and the remaining integers are 3, 5, 7. For 3, its RoI extends from 9 to 24 - and the remaining integers are 11, 13, 17, 19, 23. Generalized, the RoI extends from $P_i^2$ to $P_{i+1}^2 - 1$. For every Prime Number and after its multiples have been eliminated, within its RoI, any remaining integers will be Prime.  

The length of a Prime Number pattern is its Prime Number Factorial: $P_i$!. In progressing through the sequence of Prime Numbers, the Prime Number Factorial rapidly increases in size to extremely large values.   

Subsequent Prime Number patterns will be less successful at eliminating integers at a rate that approaches zero. The Prime Number patterns, while repeating infinitely: have a finite length, always yield more Prime Numbers, as a percentage - each new pattern will continue to become less effective at eliminating integers, and no pattern through its entire length eliminates all the Prime Number groupings. Consequently, all Prime Number groupings are infinite.  

The next available integer is $5$ because it is a remaining integer within the RoI of  $2$. All multiples of $5$ or $P_3$ that are larger than $5$ and have not already been eliminated will be eliminated. 

_ 2 3 _ 5 _ 7 _ _ _ 11 _ 13 _ _ _ 17 _ 19 _ _ _ 23 _ _ _ _ _ 29 _ 31 _ _ _ _ _ 37 _ _ _ 41 _ 43 …  

The first Strikeout is $25$ or $5^2$ or $P_3^2$. The elimination of multiples of $5$ creates the third pattern and it overlays the previous patterns. Starting at $P_3$!$ + 1$ or $26$, is an infinitely repeating finite pattern with a length of $30$ or $2 * 3 * 5$ or $P_1 * P_2 * P_3$ or $P_3$!. Within each $P_3$! pattern, two additional elements or $6.66$% of the pattern has been eliminated. When combined with the $66.6$% elimination of the previous pattern, then for the set of positive integers, $73.3$% of that set has been eliminated. The $P_3$! pattern is:  

$I$ _ _ _ _ _ $I$ _ _ _ $I$ _ $I$ _ _ _ $I$ _ $I$ _ _ _ $I$ _ _ _ _ _ $I$ _  

With the application of each new sieve, a new infinitely repeating finite pattern appears. Starting with the $P_3$! pattern, it is easy to discern that within the pattern – from the first integer through the next-to-last integer – is a symmetrical sequence of remaining integers and of new strikeouts. What can be observed in this pattern and all subsequent patterns is that the midpoint of the pattern is surrounded by a Prime Quadruple candidate.  

These patterns and their effects can be found at every $IP_i$! – at every multiple of a Prime Factorial. The patterns become more predictive as $P_i$! becomes larger and the percentage of Strikeouts gets closer to zero.  

Prime Number patterns can be used to locate rich sets of Prime Number candidates and the faster and more efficient discovery of yet-to-be-discovered Prime Numbers. This can be illustrated by looking at how the patterns appear adjacent to a very large Prime Factorial.  

Create a linear sieve and eliminate all multiples of $2$ or $P_1$:  

1 _ 3 _ 5 _ 7 _ 9 _ 11 _ 13 _ 15 _ 17 _ 19 _ 21 _ 23 _ 25 _ 27 _ 29 _ 31 _ 33 …  

The sequence of integers is a counting line - enumerating the integers after a large Prime Factorial or after a multiple of a large Prime Factorial. The “$1$” means only that it is the first integer after the Prime Factorial. All the Prime patterns that comprise the Prime Factorial end simultaneously at the Prime Factorial and simultaneously begin again at the next integer after the Prime Factorial. Consequently, both the next integer after the Prime Factorial and the integer immediately preceding the Prime Factorial are Prime candidates. A Prime Factorial and any multiple of a Prime Factorial will always be surrounded by a Prime Twin candidate. The bigger the Prime Factorial, the more likely it is that the Prime Factorial is preceded by or followed by a Prime Number or even surrounded by a Prime Twin. The bigger the Prime Factorial, the less chance there is that either or both of the integers surrounding the Prime Factorial will be eliminated by subsequent patterns.  

Eliminate all multiples of $P_2$ or $3$:  

1 _ _ _ 5 _ 7 _ _ _ 11 _ 13 _ _ _ 17 _ 19 _ _ _ 23 _ 25 _ _ _ 29 _ 31 _ _ …  

The first Strikeout will always be $P_i$ and the second Strikeout will always be $P_i^2$, in this case: 3 and 9. The next few Strikeouts will be the Prime Number multiplied by the following Prime Numbers up to the square of the next Prime Number. In this case, the first few Strikeouts are:  

$3 * 1 = 3, 3 * 3 = 9, 3 * 5 = 15, 3 * 7 = 21$  

This list stops here because the next multiplication would be $3 * 11 = 33$ which is larger than 25 or $5^2$. Remembering that these integers follow a very large Prime Factorial; the RoI says that any integers remaining within the RoI are Prime candidates.

After the P2 Strikeouts, it is easy to see that there will be infinite Prime Twin candidates and infinite Prime Quadruple candidates and an infinite quantity of candidates for all other Prime Number groupings. Remember, this follows a very large Prime Factorial. Cumulatively, the Strikeouts of all subsequent patterns will be too sparse to eliminate all of the Prime Number groupings.  

Eliminate all multiples of $P_3$ or $5$:  

1 _ _ _ _ _ 7 _ _ _ 11 _ 13 _ _ _ 17 _ 19 _ _ _ 23 _ _ _ _ _ 29 _ 31 _ _ …  

Observe the increasing gap between the first integer on either side of the Prime Factorial and the next remaining integer on either side of the Prime Factorial. The minimum length of this Prime Gap increases in length according to the sequence of Prime Numbers. This Prime Gap can be longer if either or both of the Prime Candidates adjoining the Prime Factorial are eliminated by subsequent patterns. If both of the Prime Candidates adjoining the Prime Factorial are eliminated, then a very large Prime Gap has been discovered.  

Observe the increasing length of the stable or consistent pattern between the first and second Strikeouts - between $P_i$ and $P_i^2$. While the pattern segments on either side and nearest the Prime Factorial lengthens according to the sequence of Prime Numbers, the next pattern segment lengthens according to the sequence of the squares of Prime Numbers.  

By using a linear format for the Prime Number Sieve, the following observations can be made about prime numbers:  


A unique finite pattern that repeats infinitely is associated with each prime number.  
Within each pattern, the sequence from the first integer through the next-to-last integer is symmetrical.  
Each successive Prime Number pattern has a length equal to its Prime Factorial.  
Each successive Range of Influence (RoI) increases in length according to the sequence of Prime Number Squares. The length of an RoI is: $P_{i+1}^2 - P_i^2$.  
The RoI of $2$ and $3$ contain complete patterns. All other RoI contain only a pattern segment. When examining only the sequence of Prime Numbers, discerning complete  patterns is impossible. The use of a horizontal sieve allows complete patterns to be discerned.  
The pattern of $2$ displays the obvious – only odd integers larger than $2$ can be prime. The pattern of $3$ visually proves that the possible Prime Number Twins, Quads, and all other Prime Number groupings are infinite. Because the subsequent Prime Number patterns have a frequency of strikeouts that rapidly descends to a zero limit and a length that follows the sequence of Prime Factorials, not all Prime Number groupings can be eliminated.  
Because the prevailing consensus has been that prime numbers have no foundational or overarching patterns, any patterns that were observed were assumed to be of a singular nature with limited range and usefulness. By using a horizontal sieve, it can be seen that Prime Numbers are derived from an infinite collection of infinitely repeating finite patterns. At least visually, this provides a better and more complete understanding of Prime Numbers. It is hoped that this visualization method will lead to answers for some of the outstanding questions about Prime Numbers.


What can be calculated:
* The length of each Prime Number pattern.
* The quantity and percentage of new or additional integers eliminated within each pattern (NEW STRIKEOUTS or NS).
* The total quantity and percentage of integers eliminated by all patterns (TOTAL STRIKEOUTS or TS) from $P_1$ through $P_i$.
* The total quantity and percentage of the remaining integers not eliminated by all patterns from $P_1$ through $P_i$.  

By using Prime Number patterns, which provide natural breakpoints, there can be an exact computation and analysis of quantities, percentages, frequencies, and distributions of Prime Numbers within a pattern. Using breakpoints based on multiples or powers of 10 will yield results that are less than accurate or useful and might even be misleading.  

When graphed, the percentage of new integers eliminated within each pattern (NEW STRIKEOUTS or NS) drops substantially with the first few prime numbers and continues to descend to a zero limit.  

When graphed, the percentage of all non-prime integers increases substantially with the first few prime numbers then becomes increasingly more level. It has a limit of 100%.  

The reason for this rapid leveling is more easily apparent visually than mathematically. The endpoint of the prime gap on either side of $IP_i$! is increasing incrementally through the sequence of Prime Numbers. The beginning of the RoI is increasing incrementally through the sequence of squares of Prime Numbers. Therefore, the distance between the prime gap endpoint and the RoI beginning point (where there are no strikeouts) is also increasing incrementally through the sequence of squares of Prime Numbers and becoming an increasingly longer area of stability. Because of the initial large descent of NS% toward zero percent and perpetual movement toward a near-zero limit, the internal portion of each successive pattern also becomes more stable though more slowly.  

With a large value for $_i$, a $P_i$! pattern can be used to locate yet-to-be-discovered individual prime number candidates and prime group candidates that have a high probability of being Prime. A large $P_i$! eliminates in a single procedure almost all of the non-Prime integers and none of the Prime integers. The larger the value of $_i$, the better the probability of an associated integer candidate being a Prime Number. By providing rich sets of Prime candidates, this method will enable the faster discovery of new record-setting Prime Numbers, Prime Number groups, and making a more complete inventory of Prime Numbers.  


$P_i$! $± 1$ are prime number candidates. This means that every multiple of a Prime Factorial or $IP_i$! is surrounded by a Prime Twin candidate.  
$P_i$! $± P_j$ are prime number candidates, where $_j$ is any positive integer larger than $_i$.  
The midpoint of every pattern is surrounded by a Prime Quad candidate:
$(P_i$! $± (P_i$!$/ 2)) ± 2$ and
$(P_i$! $± (P_i$!$/ 2)) ± 4$  


The quantity and percentage of Strikeouts can be calculated without a sieve.
NS = NEW STRIKEOUTS PER PATTERN
TS = TOTAL STRIKEOUTS PER PATTERN

$NS_i = NS_{i-1}(P_{i-1} – 1)$
$TS_i = (P_i * TS_{i-1}) + NS_i$

In Excel$365$, when enhanced with xlPrecision (PrecisionCalc.com), calculations can have as many as $32,767$ significant digits. Those with access to applications and computers with larger capabilities and faster computations are invited and encouraged: to continue these iterations and determine when NS% is less than $10^{-5}, 10^{-6}, 10^{-7}$ …; when TS% is greater than $96$%, $97$%, $98$% …; and to compute and share very large Prime Factorials that will make the search for as-yet-undiscovered Prime Numbers be faster and more productive.  

The NS% is less than $0.1$% at $P_{31}$ or $127$. The NS% is less than $.01$% at $P_{146}$ or $839$. The NS% is less than $.001$% at $P_{833}$ or $6,397$. The NS% is less than $.0001$% at $P_{5294}$ or $51,713$.  

The TS% is greater than $90$% at $P_{55}$ or $257$. The TS% is greater than $91$% at $P_{93}$ or $487$. The TS% is greater than $92$% at $P_{181}$ or $1,087$. The TS% is greater than $93$% at $P_{429}$ or $2,971$. The TS% is greater than $94$% at $P_{1387}$ or $11,489$. The TS% is greater than $95$% at $P_{7388}$ or $74,891$.  

For example: Where $_i = 4$
$P_4 = 7$  

$NS = NS_{i-1} (P_{i-1} – 1) = NS_{4-1} (P_{4-1} – 1) = NS_3 (P_3 – 1)  = 2 * (5 – 1) = 2 * 4 = 8$  

$TS = (P_i * TS_{i-1}) + NS_i = (P_4 * TS_{4-1}) + NS_4 = (P_4 * TS_3) + NS_4 = (7 * 22) + 8 = 154 + 8 = 162$  

$P_4$! $= P_1 * P_2 * P_3 * P_4 = 2 * 3 * 5 * 7 = 210$  

$NS$%$ = 8 / 210 = 3.8095238095238$%  

$TS$%$ = 162 / 210 = 77.1428571428571$%  

Finally, those with advanced math skills are invited to convert these observations into a correct mathematical form.