Project Euler 207: Integer partition equations
For some positive integers k, there exists an integer partition of the form 4t = 2t + k,
where 4t, 2t, and k are all positive integers and t is a real number.
The first two such partitions are 41 = 21 + 2 and 41.5849625… = 21.5849625… + 6.
Partitions where t is also an integer are called perfect.
For any m ≥ 1 let P(m) be the proportion of such partitions that are perfect with k ≤ m.
Thus P(6) = 1/2.
In the following table are listed some values of P(m)
P(5) = 1/1
P(10) = 1/2
P(15) = 2/3
P(20) = 1/2
P(25) = 1/2
P(30) = 2/5
P(180) = 1/4
P(185) = 3/13
Find the smallest m for which P(m) < 1/12345
Project Euler 207 SolutionRuns < 0.001 seconds in Python 2.7.
Use this link to get the Project Euler 207 Solution Python 2.7 source.
AnswerSlowly swipe from either end beginning with the white vertical bar to get an idea of the starting or ending digits. For less drama, just double click the answer area. The distance between the two bars will give you an idea of the magnitude. Touch devices can tap and hold the center of the box between the two bars and choose define to reveal the answer.
No afterthoughts yet.
Partition is perfect when first element is a power of 2.
I think the original problem statement is intentionally obtuse to make the problem appear more difficult.,
For L = 123456; Smallest m for which P(m) < 1 / 123456 = 6721458093506 [/comments]