Name: Anonymous 2013-06-27 0:53
Finally, I have found a solution that generates non-primes that can easily be understood by the layman.
Interestingly enough this also can be used to find prime numbers, as no number returned by this function is an element of the set of primes, greatly reducing the search space.
int nonprime() {return (rand() + 2) * 5;}Interestingly enough this also can be used to find prime numbers, as no number returned by this function is an element of the set of primes, greatly reducing the search space.