Files
freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-207-integer-partition-equations.md
gikf eef1805fe6 fix(curriculum): clean-up Project Euler 201-220 (#42826)
* fix: clean-up Project Euler 201-220

* fix: corrections from review

Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>

Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
2021-07-15 09:20:31 +02:00

1.4 KiB

id, title, challengeType, forumTopicId, dashedName
id title challengeType forumTopicId dashedName
5900f43c1000cf542c50ff4e Problem 207: Integer partition equations 5 301848 problem-207-integer-partition-equations

--description--

For some positive integers k, there exists an integer partition of the form 4^t = 2^t + k,

where 4^t, 2^t, and k are all positive integers and t is a real number.

The first two such partitions are 4^1 = 2^1 + 2 and 4^{1.584\\,962\\,5\ldots} = 2^{1.584\\,962\\,5\ldots} + 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) = \frac{1}{2}.

In the following table are listed some values of P(m)

$$\begin{align} & P(5) = \frac{1}{1} \\ & P(10) = \frac{1}{2} \\ & P(15) = \frac{2}{3} \\ & P(20) = \frac{1}{2} \\ & P(25) = \frac{1}{2} \\ & P(30) = \frac{2}{5} \\ & \ldots \\ & P(180) = \frac{1}{4} \\ & P(185) = \frac{3}{13} \end{align}$$

Find the smallest m for which P(m) &lt; \frac{1}{12\\,345}

--hints--

integerPartitionEquations() should return 44043947822.

assert.strictEqual(integerPartitionEquations(), 44043947822);

--seed--

--seed-contents--

function integerPartitionEquations() {

  return true;
}

integerPartitionEquations();

--solutions--

// solution required