self initialized quadratic sieve implementation