I am currently creating a program to exhaustively search for prime numbers. I head from sombody that this rule can be extended by multipliting 6 by the next prime number, giving 30, and then continuing this sequence 210.
The offsets from this value would be the prime numbers less than it, apart from the ones multiplied together to make this value, and also 1.
This works for 30, meaning the values you will need to check would be $30n+1$, $30n+7$, $30n+11$, $30n+13$, $30n+17$, $30n+19$, $30n+23$ and $30n+29$
However, there is something that is missing for the larger values, the person that I learnt rule from said that there was a way to make it work for $210n$ and upwards, however they forgot how.
With a base value of 210 you need to check 1, and all the prime numbers lower than 210, not including the prime factors of 210, as above. However you also need to check $210n+121$, $210n+143$, $210n+169$, $210n+187$ and $210n+209$.
Any help in figuring out what the rules for the other values to be checked are for values larger than $210n$ would be greatly appreciated, since I need to automatically work these out for huge values of $n$.