61 lines
1.1 KiB
Markdown
61 lines
1.1 KiB
Markdown
---
|
|
id: 5900f45c1000cf542c50ff6e
|
|
challengeType: 5
|
|
title: 'Problem 239: Twenty-two Foolish Primes'
|
|
---
|
|
|
|
## Description
|
|
<section id='description'>
|
|
A set of disks numbered 1 through 100 are placed in a line in random order.
|
|
|
|
What is the probability that we have a partial derangement such that exactly 22 prime number discs are found away from their natural positions?
|
|
(Any number of non-prime disks may also be found in or out of their natural positions.)
|
|
|
|
Give your answer rounded to 12 places behind the decimal point in the form 0.abcdefghijkl.
|
|
</section>
|
|
|
|
## Instructions
|
|
<section id='instructions'>
|
|
|
|
</section>
|
|
|
|
## Tests
|
|
<section id='tests'>
|
|
|
|
```yml
|
|
tests:
|
|
- text: <code>euler239()</code> should return 0.001887854841.
|
|
testString: 'assert.strictEqual(euler239(), 0.001887854841, "<code>euler239()</code> should return 0.001887854841.");'
|
|
|
|
```
|
|
|
|
</section>
|
|
|
|
## Challenge Seed
|
|
<section id='challengeSeed'>
|
|
|
|
<div id='js-seed'>
|
|
|
|
```js
|
|
function euler239() {
|
|
// Good luck!
|
|
return true;
|
|
}
|
|
|
|
euler239();
|
|
```
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</section>
|
|
|
|
## Solution
|
|
<section id='solution'>
|
|
|
|
```js
|
|
// solution required
|
|
```
|
|
</section>
|