RosettaCodeData/Task/Sphenic-numbers/00-TASK.txt

43 lines
1.4 KiB
Plaintext

;Definitions
A '''sphenic number''' is a positive integer that is the product of three distinct prime numbers. More technically it's a square-free 3-almost prime (see Related tasks below).
For the purposes of this task, a '''sphenic triplet''' is a group of three sphenic numbers which are consecutive.
Note that sphenic quadruplets are not possible because every fourth consecutive positive integer is divisible by 4 (= 2 x 2) and its prime factors would not therefore be distinct.
;Examples
30 (= 2 x 3 x 5) is a sphenic number and is also clearly the first one.
[1309, 1310, 1311] is a sphenic triplet because 1309 (= 7 x 11 x 17), 1310 (= 2 x 5 x 31) and 1311 (= 3 x 19 x 23) are 3 consecutive sphenic numbers.
;Task
Calculate and show here:
1. All sphenic numbers less than 1,000.
2. All sphenic triplets less than 10,000.
;Stretch
3. How many sphenic numbers are there less than 1 million?
4. How many sphenic triplets are there less than 1 million?
5. What is the 200,000th sphenic number and its 3 prime factors?
6. What is the 5,000th sphenic triplet?
Hint: you only need to consider sphenic numbers less than 1 million to answer 5. and 6.
;References
* [[wp:Sphenic_number|Wikipedia: Sphenic number]]
* [[oeis:A007304|OEIS:A007304 - Sphenic numbers]]
* [[oeis:A165936|OEIS:A165936 - Sphenic triplets (in effect)]]
;Related tasks
* [[Almost prime]]
* [[Square-free integers]]
<br>