We find conditions under which the numerator of the zeta-function of the curve y2+y = xd over Fp, where d — 2g +1 is a prime, d ≠ p, is irreducible over Q. This leads to the generalized Mersenne problem of "almost primality" of the number of points on the jacobian of such a curve over an extension of Fp, which has application to public key cryptography.