Integer partitions detect the primes