Cuban prime (source code)

= Cuban prime

A <prime number> expressible as $(x^3-y^3)/(x-y)=x^2+xy+y^2$ for specified consecutive or nearly consecutive <positive integers>. The first kind has $x=y+1$ and therefore the form $3y^2+3y+1$; the second kind has $x=y+2$ and therefore the form $3y^2+6y+4$. The first kind arises when a <difference of two cubes> is itself <prime>: the factorization $x^3-y^3=(x-y)(x^2+xy+y^2)$ forces $x-y=1$ for $x>y>0$.