Prime Numbers: 6k-1 mod rule (New Discovery?)

I've noticed that although all primes follow the pattern of $6k - 1$ and $6k + 1$ which seems to be a somewhat known fact.

However, I also noticed that all the primes of the pattern of $6k - 1$ only need to be tested against those that are also $6k - 1$ (beyond the square root, to a sixth of its size). Has this ever been discovered before? Would this algorithm in theory be faster to find the largest prime faster than current algorithms?

In theory, all one would need to do is multiply six by billions of digits, and then mod once across the spectrum by all products of $6k - 1$, faster even if we know if those $6k - 1$ numbers are already prime.

For instance $6k - 1$ where $k = 100$, therefore we are testing if 599 is prime. For this number we only need to test all $6k - 1 \times 6 \leq 599$.

Here is Java code that does a half-sieve and performs fairly fast since it doesn't mod, but merely crosses off multiples of each number in the sieve.

public class primesUnder {

public static void main(String[] args) {

    int maxNumber = 100;
    int[] primesUnder = new int[maxNumber];

    for (int i=5, count=0; count < maxNumber; i+=6) {
        primesUnder[count++]=i; 
    }

    for (int index=0; index < maxNumber; index++) {

        if (primesUnder[index] != 0) {

            int x = primesUnder[index];
            int z = x+index;

            while (z < primesUnder.length) {

                primesUnder[z] = 0;
                z+=x;

            }
        }   
    }

  }

}

If a number $n=6k-1$ is decomposed as a product of not necessarily distinct primes $$ n=6k-1=p_1\cdot\cdots\cdot p_t $$ at least one of the $p_i$ must be of the form $6k^\prime-1$. This is actually pretty obvious using modular arithmetic for the modulus $6$.

Indeed, no $p_i$ can be either $2$ or $3$ since the lhs is not divisibile by $2$ or $3$. Thus the displayed formula reads $$ n\equiv-1\equiv(\pm1)\cdot\cdots\cdot (\pm1)\bmod 6 $$ and for it to hold at least one factor on the rhs (and in fact an odd number of factors) must be $-1$.


You asked two questions, and the existing answer only responds to one of them. The answer to

Would this algorithm in theory be faster to find the largest prime faster than current algorithms?

is no, but for a rather specific reason. The ten largest known primes are all Mersenne primes, primes of the form $2^p - 1$ where $p$ is prime. The reason is that there's a particularly fast way to test numbers of this form for primality, the Lucas-Lehmer primality test. (And as a side-note, Mersenne primes are all equivalent to $1 \pmod 6$).