PyPE solution to PE problem 47
PyPE solution to PE problem 47
Blueprint information
- Status:
- Complete
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- None
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- Approved
- Series goal:
- None
- Implementation:
-
Implemented
- Milestone target:
- None
- Started by
- Scott Armitage
- Completed by
- Scott Armitage
Related branches
Related bugs
Sprints
Whiteboard
ProjectEule
===
The first two consecutive numbers to have two distinct prime factors are:
14 = 2 * 7
15 = 3 * 5
The first three consecutive numbers to have three distinct prime factors
are:
644 = 2**2 * 7 * 23
645 = 3 * 5 * 43
646 = 2 * 17 * 19.
Find the first four consecutive integers to have four distinct primes
factors. What is the first of these numbers?
Solution
--------
We have an efficient algorithm for generating a list of prime factors of a
number. For each starting integer i, we determine wither i, i+1, i+2, and
i+3 all have 4 prime distinct prime factors by converting this generated
list into a set.
Answer
------
134043