I have derived the following theorem:
An odd positive integer $N=6n−1$ is a prime iff neither of two diophantine equations
$6x^2+(6x−1)y=n$
$6x^2+(6x+1)y=n$
has solution.
An odd positive integer $N=6n+1$ is a prime iff neither of two diophantine equations
$6x^2−2x+(6x−1)y=n$
$6x^2+2x+(6x+1)y=n$
has solution.
$x=1,2,3,\ldots;y=0,1,2,\ldots;n=1,2,3,\ldots$
Theorem allows to substitute the task: "Find all primes in the range $(N_1;N_2)$" by the task: "Find positive integers which do not appear in the range $(n_1;n_2)$ in two pairs of $2$-dimensional arrays
$P_1(i,j)=6i^2+(6i-1)(j-1)$
$P_2(i,j)=6i^2+(6i+1)(j-1)$
$i,j = 1,2,3,\ldots$
for primes in the sequence $N=6n-1$.
$P_3(i,j)=6i^2-2i+(6i-1)(j-1)$
$P_4(i,j)=6i^2+2i+(6i+1)(j-1)$
$i,j = 1,2,3,\ldots$
for primes in the sequence $N=6n+1$. Since all primes (except $2$ and $3$) are in one of two forms $6n−1$ or $6n+1$, so we can find primes simply by picking up positive integers which do not appear in these arrays and we need not to perform operations of dividing. See http://www.planet-source-code.com/vb/scripts/BrowseCategoryOrSearchResults.asp?lngWId=3&blnAuthorSearch=TRUE&lngAuthorId=21687209&strAuthorName=Boris%20Sklyar&txtMaxNumberOfEntriesPerPage=25
Can proposed algorithm be regarded as an alternative to sieve of Eratosthenes?