New prime generation algorithm