prime generator, general method of determining subset/equality of sets