prime finding algo