Tweeted twitter.com/StackCodeGolf/status/894705680854249472 occurred Aug 7 '17 at 23:43 4 added 10 characters in body edited Aug 7 '17 at 23:15 Nick T 2,49211 gold badge1212 silver badges3434 bronze badges Surprisingly, I don't think we have a code-golf question for determining if a number is semiprime. A semiprime is a natural number that is the product of two (not necessarily distinct) prime numbers. Simple enough, but a remarkably important concept. Given a positive integer, determine if it is a semiprime. Your output can be in any form so long as it gives the same output for any truthy or falsey value. You may also assume your input is reasonably small enough that performance or overflow aren't an issue. Test cases: input -> output 1 -> false 2 -> false 3 -> false 4 -> true 6 -> true 8 -> false 30 -> false (5 * 3 * 2), note it must be EXACTLY 2 (non-distinct) primes 49 -> true (7 * 7) still technically 2 primes 95 -> true 25195908475657893494027183240048398571429282126204032027777137836043662020707595556264018525880784406918290641249515082189298559149176184502808489120072844992687392807287776735971418347270261896375014971824691165077613379859095700097330459748808428401797429100642458691817195118746121515172654632282216869987549182422433637259085141865462043576798423387184774447920739934236584823824281198163815010674810451660377306056201619676256133844143603833904414952634432190114657544454178424020924616515723350778707749817125772467962926386356373289912154831438167899885040445364023527381951378636564391212010397122822120720357 -> true, and go call someone, you just cracked RSA-2048  This is code-golf, so standard rules apply! Surprisingly, I don't think we have a code-golf question for determining if a number is semiprime. A semiprime is a natural number that is the product of two (not necessarily distinct) prime numbers. Simple enough, but a remarkably important concept. Given a positive integer, determine if it is a semiprime. Your output can be in any form so long as it gives the same output for any truthy or falsey value. You may also assume your input is reasonably small enough that performance or overflow aren't an issue. Test cases: input -> output 1 -> false 2 -> false 3 -> false 4 -> true 6 -> true 8 -> false 30 -> false (5 * 3 * 2), note it must be EXACTLY 2 (non-distinct) primes 49 -> true (7 * 7) still technically 2 primes 95 -> true 25195908475657893494027183240048398571429282126204032027777137836043662020707595556264018525880784406918290641249515082189298559149176184502808489120072844992687392807287776735971418347270261896375014971824691165077613379859095700097330459748808428401797429100642458691817195118746121515172654632282216869987549182422433637259085141865462043576798423387184774447920739934236584823824281198163815010674810451660377306056201619676256133844143603833904414952634432190114657544454178424020924616515723350778707749817125772467962926386356373289912154831438167899885040445364023527381951378636564391212010397122822120720357 -> go call someone, you just cracked RSA-2048  This is code-golf, so standard rules apply! Surprisingly, I don't think we have a code-golf question for determining if a number is semiprime. A semiprime is a natural number that is the product of two (not necessarily distinct) prime numbers. Simple enough, but a remarkably important concept. Given a positive integer, determine if it is a semiprime. Your output can be in any form so long as it gives the same output for any truthy or falsey value. You may also assume your input is reasonably small enough that performance or overflow aren't an issue. Test cases: input -> output 1 -> false 2 -> false 3 -> false 4 -> true 6 -> true 8 -> false 30 -> false (5 * 3 * 2), note it must be EXACTLY 2 (non-distinct) primes 49 -> true (7 * 7) still technically 2 primes 95 -> true 25195908475657893494027183240048398571429282126204032027777137836043662020707595556264018525880784406918290641249515082189298559149176184502808489120072844992687392807287776735971418347270261896375014971824691165077613379859095700097330459748808428401797429100642458691817195118746121515172654632282216869987549182422433637259085141865462043576798423387184774447920739934236584823824281198163815010674810451660377306056201619676256133844143603833904414952634432190114657544454178424020924616515723350778707749817125772467962926386356373289912154831438167899885040445364023527381951378636564391212010397122822120720357 -> true, and go call someone, you just cracked RSA-2048  This is code-golf, so standard rules apply! 3 Test case 8 edited Aug 7 '17 at 19:47 xnor 97.3k1919 gold badges201201 silver badges460460 bronze badges Surprisingly, I don't think we have a code-golf question for determining if a number is semiprime. A semiprime is a natural number that is the product of two (not necessarily distinct) prime numbers. Simple enough, but a remarkably important concept. Given a positive integer, determine if it is a semiprime. Your output can be in any form so long as it gives the same output for any truthy or falsey value. You may also assume your input is reasonably small enough that performance or overflow aren't an issue. Test cases: input -> output 1 -> false 2 -> false 3 -> false 4 -> true 6 -> true 8 -> false 30 -> false (5 * 3 * 2), note it must be EXACTLY 2 (non-distinct) primes 49 -> true (7 * 7) still technically 2 primes 95 -> true 25195908475657893494027183240048398571429282126204032027777137836043662020707595556264018525880784406918290641249515082189298559149176184502808489120072844992687392807287776735971418347270261896375014971824691165077613379859095700097330459748808428401797429100642458691817195118746121515172654632282216869987549182422433637259085141865462043576798423387184774447920739934236584823824281198163815010674810451660377306056201619676256133844143603833904414952634432190114657544454178424020924616515723350778707749817125772467962926386356373289912154831438167899885040445364023527381951378636564391212010397122822120720357 -> go call someone, you just cracked RSA-2048  This is code-golf, so standard rules apply! Surprisingly, I don't think we have a code-golf question for determining if a number is semiprime. A semiprime is a natural number that is the product of two (not necessarily distinct) prime numbers. Simple enough, but a remarkably important concept. Given a positive integer, determine if it is a semiprime. Your output can be in any form so long as it gives the same output for any truthy or falsey value. You may also assume your input is reasonably small enough that performance or overflow aren't an issue. Test cases: input -> output 1 -> false 2 -> false 3 -> false 4 -> true 6 -> true 30 -> false (5 * 3 * 2), note it must be EXACTLY 2 (non-distinct) primes 49 -> true (7 * 7) still technically 2 primes 95 -> true 25195908475657893494027183240048398571429282126204032027777137836043662020707595556264018525880784406918290641249515082189298559149176184502808489120072844992687392807287776735971418347270261896375014971824691165077613379859095700097330459748808428401797429100642458691817195118746121515172654632282216869987549182422433637259085141865462043576798423387184774447920739934236584823824281198163815010674810451660377306056201619676256133844143603833904414952634432190114657544454178424020924616515723350778707749817125772467962926386356373289912154831438167899885040445364023527381951378636564391212010397122822120720357 -> go call someone, you just cracked RSA-2048  This is code-golf, so standard rules apply! Surprisingly, I don't think we have a code-golf question for determining if a number is semiprime. A semiprime is a natural number that is the product of two (not necessarily distinct) prime numbers. Simple enough, but a remarkably important concept. Given a positive integer, determine if it is a semiprime. Your output can be in any form so long as it gives the same output for any truthy or falsey value. You may also assume your input is reasonably small enough that performance or overflow aren't an issue. Test cases: input -> output 1 -> false 2 -> false 3 -> false 4 -> true 6 -> true 8 -> false 30 -> false (5 * 3 * 2), note it must be EXACTLY 2 (non-distinct) primes 49 -> true (7 * 7) still technically 2 primes 95 -> true 25195908475657893494027183240048398571429282126204032027777137836043662020707595556264018525880784406918290641249515082189298559149176184502808489120072844992687392807287776735971418347270261896375014971824691165077613379859095700097330459748808428401797429100642458691817195118746121515172654632282216869987549182422433637259085141865462043576798423387184774447920739934236584823824281198163815010674810451660377306056201619676256133844143603833904414952634432190114657544454178424020924616515723350778707749817125772467962926386356373289912154831438167899885040445364023527381951378636564391212010397122822120720357 -> go call someone, you just cracked RSA-2048  This is code-golf, so standard rules apply! 2 edited tags | link edited Aug 7 '17 at 19:04 Stephen 7,83322 gold badges3535 silver badges100100 bronze badges Post Reopened by DavidC code-golf occurred Aug 7 '17 at 18:45 Post Closed as "duplicate" by Sriotchilism O'Zaic, AdmBorkBork code-golf of occurred Aug 7 '17 at 18:38 1 asked Aug 7 '17 at 18:23 Lord Farquaad 9581010 silver badges2424 bronze badges