Implement quest 'primality_check'.